Each year in the U.S., an estimated 120,000 children are welcomed into families through adoption. If adopting a baby is something you’d like to consider, the obvious question is: Just how much does it cost?

The expenses range from next to nothing on up to $40,000, depending on the type of adoption you’re seeking.

Here are the costs associated with four primary adoption methods.

1. Private agency adoption

Licensed adoption agencies in each state help match prospective parents with expectant mothers or couples. These private agencies work outside the public welfare system.

The overall cost for a private adoption ranges from $20,000 to $45,000. Fees may include a home study to determine the prospective family’s eligibility to adopt a baby ($1,500-$4,000), parental preparation and training courses, court documentation ($500-$2,000), legal fees ($1,500-4,000), counseling for the birth parents, and medical and legal expenses of the birth parents.

Each state has its own laws pertaining to adoption that need to be followed, and that’s true of the state the adoptive parents live in, the state the birth mother lives in, and the state the baby is born in, if that’s different from the other two. Likewise, each private adoption agency within each state charges its own set of fees. It is important for adoptive parents to get written verification of what an agency’s fees do and do not cover so no one is surprised by unexpected costs.

To cover the expense of a private agency adoption, a family may want to explore tapping their home equity.

2. Independent adoption

When birth parents and adoptive parents already know each other, they seek the assistance of an attorney for an independent adoption. Costs are usually lower than using a private agency, but generally range from $15,000 to $40,000.

Fees include, but are not necessarily limited to, a home study, legal fees for both the adoptive and birth parents, court documentation fees and medical expenses for the birth mother. State laws govern these medical reimbursements.

A personal loan or a savings account might be another way for a family to cover adoption costs.

3. Foreign adoption

Adopting a baby outside of the United States costs $20,000 to $50,000 or more, depending on the country involved. Costs are generally higher due to foreign travel and immigration processing. Expenses also include court fees and mandatory adoption education for adoptive families, adoption agency fees and necessary documentation.

Additional expenses can include escort fees if adoptive parents cannot travel to bring the baby to the United States, translation fees, medical treatment for the baby, foreign attorney fees, passport and visa processing fees and medical exams.

American families who adopt a foreign-born baby must follow the Hague Convention on Protection of Children and Cooperation in Respect of Intercountry Adoption, a treaty with participating countries that protects the rights and well-being of children and families involved in these adoptions.

Creating a Family, a nonprofit adoption education organization, reports that China and South Korea are the top countries for foreign adoptions. The average cost for each is about $30,000. Ethiopia was on that list, but it suspended international adoptions in May 2017.

4. Foster care

Children of all ages are in the foster care system and are eligible for adoption. While many older children in foster care are available for adoption, it is possible to adopt a baby. This is the most cost-efficient means of adopting an infant, with little to no cost involved because federal and state adoption programs cut down on the usual financial obstacles.

The top priority of the welfare system is to reunite a baby with the birth parents safely. If the baby is removed from the home, the mother or parents usually have six months to comply with certain stipulations while the baby is placed in foster care. This time can be extended, depending on the parents’ progress. Therefore, foster children of infant age are usually not eligible for adoption.

An exception is made for babies who are legally abandoned by their mother or parents to a Safe Haven or Safe Surrender program, often within days of their birth, or even hours in the case of the mother or baby testing positive for illegal drugs at birth. Birth parents are given two weeks to two months (depending on the state) to regain custody if they have a change of heart. After this, the baby is free to be adopted.