When I went to purchase my first car, I was naïve about how much it would cost. I had my father with me because he was knowledgeable about the car shopping process. Still, I was surprised by how much I spent after adding up all the extra costs, such as taxes and fees.

Having a budget is critical when shopping for a car. When you create yours, remember to account for everything you’ll pay for the vehicle—now and in the future. Here are the three biggest car-buying costs that caught me by surprise. Don’t overlook them like I did if you’re in the market for a car.

1. Sales Tax

When I purchased my car, I did not budget for the sales tax. Depending on the state in which you reside, sales tax is unavoidable (like in Illinois, where I bought my car). However, just how much tax you pay can vary by state.

I bought my car in Bourbonnais, Ill. (Kankakee County) because my parents lived near there and had a relationship with a dealership. There, the vehicle purchase sales tax was 6.250%. Since my car cost around $18,000, the tax tacked an additional $1,125 onto my bill.

Before buying a car, research the sales tax in your area and know how much you’ll need to add to your car-buying budget to account for it. Do not get caught off guard like I did.

2. DMV Fees

Do not underestimate the fees associated with the purchase of your car. There are vehicle registration fees, title transfer fees, and used car sales tax (if purchasing a used car). The car dealerships won’t advertise these costs, so saving every penny on the purchase price that you can is essential.

For me, these fees came out to additional $2,500, which I definitely did not budget for. Now, my $18,000 vehicle had soared to a cost of more than $20,000. As a result, before I could start paying my car loan, I instead had to pay off taxes and fees first.

These taxes and fees are easy to find on your state’s DMV site. Be sure to factor them into your budget.

3. Maintenance

As my father told me throughout the car-buying process, “It isn’t whether or not you can purchase the vehicle, it’s if you can maintain the vehicle.” As a result of his advice, I opted for a vehicle that would require minimal maintenance. The most expensive service fees I’ve paid was $500 for brakes and transmission.

On the other hand, family friends of ours purchased a luxury vehicle a while back. After a year, they had to sell it because the maintenance fees were out of hand. A checkup alone cost them $500! Before purchasing a vehicle, find out what the typical maintenance costs are. You can either talk to a mechanic or go online and type in the “vehicle maintenance costs for ______.”

Purchasing a vehicle is not an easy task and requires some homework on your part. You have to consider everything from sales tax to DMV fees and maintenance costs.

Want to figure out how much car you can afford? Check out this calculator.