Buying a car is one of the biggest purchases most people make. It's easy to get caught up in the excitement and agree to a payment that looks manageable in the moment but strains your finances for years. Here's how to figure out what you can actually afford before you walk into the dealership.

The 20/4/10 rule

Financial experts often recommend the 20/4/10 rule as a starting point for car buying:

Total vehicle expenses include your loan payment, insurance, gas, and maintenance. If your take-home pay is $4,000 a month, you'd want to keep all car costs under $400 per month.

The average American car payment is now over $700 per month. That's often more than many families can comfortably afford.

Why longer loan terms are risky

Dealerships often pitch 72 or 84 month loans to make expensive cars look affordable. A $40,000 car spread over 7 years sounds manageable — but you'll pay thousands more in interest, and you'll likely owe more than the car is worth for much of the loan.

Don't forget the total cost of ownership

The sticker price and the loan payment are just part of what a car costs. Before you commit, think about:

A simple way to check your number

Take your monthly take-home pay and multiply it by 10%. That's your total car budget per month including insurance and gas. Subtract your estimated insurance and fuel costs and what's left is the most you should spend on a car payment.

For example: $5,000 take-home × 10% = $500 budget. If insurance and gas run $200 a month, your max car payment is $300.

The bottom line

The car you can afford isn't always the car you want — but buying within your means keeps you from being trapped in a payment that limits everything else in your financial life. Run the numbers before you go shopping, not after you've fallen in love with a vehicle on the lot.