According to the American Psychological Association, up to 50 percent of U.S. marriages end in divorce, levying both an emotional and financial toll on the entire family. Every case is unique, however, and the monetary cost can be just as high, or just as low, as the emotional cost. That being said, certain factors are likely to impact the cost of your divorce, including where you live, your current relationship with your spouse, whether your spouse is contesting the divorce, and the number of issues you have to resolve.

If you and your spouse have made the mutual decision to part ways, you’re on friendly terms with one another, there are no children involved, and you don’t own property, your divorce should be quick and relatively inexpensive. On the other hand, if your spouse is contesting the divorce, you jointly own several properties, and you have young children, the process may be long, drawn-out, and significantly more expensive. A skilled divorce lawyer is the best resource you have when it comes to determining your options and assessing the potential cost.

The average cost of a divorce

According to forbes.com, the average divorce in the U.S. costs around $15,000, with the majority of that expense coming from legal fees. It’s about half the average cost of a U.S. wedding—just over $30,000. And remember, $15,000 is an average; some folks have paid $1,000 and others have paid well over $100,000.

A divorce attorney can cost anywhere from $75 per hour to $450 and more per hour, with the average reported cost being $250 per hour. The cost of hiring an attorney will also depend heavily on where you live; a divorce attorney in rural Nebraska isn’t likely to cost as much as a divorce attorney in Beverly Hills, for example.

The cost of divorce when children are involved

When kids are involved, divorces take an average of 11 months and typically cost more than those not involving children. How much more is dependent on multiple factors, including whether the case goes to trial and how easily a custody agreement can be reached. If, for example, the parents are unable to reach a custody agreement on their own, a child custody evaluation may be necessary, a process that can add up to $10,000 to the total cost of a divorce.

What about mediation?

If your divorce is relatively amicable, mediation may be an option. Whereas a divorce lawyer can only represent one spouse in the divorce proceedings, a mediator (who may also be an attorney) is a neutral third party hired by both spouses to resolve their differences cooperatively.

“You still have to pay for a mediator, but the process is typically much shorter and much less expensive,” says Renee LaPoint, president of the New York State Council on Divorce Mediation (NYSCDM). “On average, divorce mediation can save couples tens of thousands of dollars. The average length of a divorce mediation is determined by how well the couple makes decisions together, but usually takes much less time—even months—rather than a typical litigated divorce, which can last years.”

LaPoint goes on to explain that mediated divorce agreements tend to be more durable and sustainable than litigated agreements. “In a mediated process, the couples have created a divorce agreement together that they have buy-in for and take ownership of.”

Hiring a divorce attorney

According to Elise Pettus, founder of UNtied, an online resource for women going through or contemplating divorce, it’s important to remember that every attorney-client interaction costs money, even if the engagement only lasts a few minutes, and even if it’s over the phone. Many lawyers bill in increments of six minutes or less.

“Try to keep in mind that [a divorce] is a business transaction,” says Pettus. “This can sometimes help people remember to be efficient with their attorneys.”

When couples get divorced, the process is as unique as their marriage. Fortunately, an experienced divorce attorney can help to ensure that your divorce is as smooth, and painless, as possible.