Tesla CEO Elon Musk views the new Tesla Model Y at its unveiling in Hawthorne, California on March 14, 2019.

Americans have a complicated relationship with cars. Aside from buying a home, a car is probably the second-most expensive purchase you will ever make in your life. After more than 10 years of writing about money on my personal finance website, Financial Samurai, I've found that being too fixated on the advertised price of a car is the biggest — and most expensive — mistake buyers make. Too often, people will purchase a car without having a realistic understanding of how much more it will actually cost to own it. As a result, they end up spending too much and exceeding their budget. I've read and heard countless stories from readers, friends and family members (even myself, unfortunately) guilty of doing this.

Never spend more than this much of your income on a car

To save others from making this costly mistake, I came up with the 1/10th rule for buying a car. It's simple: Spend no more than 10% of your gross annual income on the purchase price of a car. Why? Because the upfront cost of a vehicle isn't going to be the only thing you pay for, and cutting down your base price budget is the most effective way to save money. If you make the median per capita income of about $42,000 a year, for example, you should limit your budget to $4,200. If you make the median household income of about $62,000 a year, don't spend more than $6,200 on a car.

Why you may regret not following the 1/10th rule

According to a 2019 report from Experian, which tracks millions of auto loans each month, the average amount borrowed to buy a new vehicle hit a record $32,187 in the first quarter. The average used-vehicle loan also hit a record, $20,137. That's far more than what most American households can afford. Even so, Experian found that 20% of borrowers are taking out loans of $50,000 or more. That means, median income earners who buy median-priced cars are essentially spending almost 80% of their gross salary. Worst of all, after they pay a 20% effective tax rate on their annual gross income, they'll be spending almost 100% of their net income on the car! Here are a few other major (though rarely considered) reasons why spending more than 10% of your annual income on a car is a horrible idea: 1. Maintenance (and other hidden) costs will eat up your savings. The more you drive your car, the more expensive it will cost to maintain it. With thousands of parts to each vehicle, something will inevitably break, leak or need upgrading, especially after the warranty runs out. And it's not just maintenance costs: You'll also have to pay for things like gas, interest on financing, insurance, parking and traffic tickets. Furthermore, the thrill of owning a new or "new-ish" used car lasts for only several months, but the pain of paying the same car payment will last for years. 2. The opportunity cost is a huge bummer. When you buy a car, you lose the opportunity to invest your money into assets that can grow and pay dividends in the future, such as real estate or stocks. The effects of compound interest are more powerful when you save early and often. Spending beyond a realistic budget is like negative compounding. Think about how rich you'd be today if you had invested around $300 to $500 in the stock market since 2009 — instead of spending it all on monthly car payments! I learned this lesson the hard way: In 2001, I purchased a one-year-old Mercedes G500 SUV for $79,000. It seemed like a great deal at the time, considering it sold for $150,000 the year before at a dealership that had exclusive import and selling rights to the model. But shortly after, I experienced buyer's remorse. Owning the car was costing me more than I had anticipated, and it was ruining my finances. The biggest bummer? I later found a two-bedroom, two-bathroom condo facing the park in San Francisco that I really wanted to buy. Unfortunately, the SUV was too big to fit into the garage. So in 2003, I sold the car for a $15,000 loss, took over a 1997 Honda Civic from my mom for $7,000 and bought the condo for $580,500. Buying property was the right move; the condo is now worth roughly $1.4 million and provides steady passive rental income for my family. Still, not following the 1/10th rule and losing $15,000 hurt like hell. 3. You'll have a lot more to stress about. When you spend more than 10% of your income on a car, your stress levels will likely increase. Each time you park your car at the local grocery store, for example, you'll worry about getting a door ding. Or you may get stressed out for an entire week due to a wheel rash that incurred after you parallel parked too close to the curb. And when you're driving in traffic, you may feel more on edge because you're worried that someone will damage your car. When you spend within your true budget, however, you stop caring about door dings and bumper scrapes. Driving and parking becomes a stress-free experience. 4. You may want to spend even more money on your car. The nicer your car, the more you may be tempted to spend on other car-related luxuries. You might consider getting some nice driving shoes, for example, or a matching chronometer watch for your sports vehicle.

I know dozens of people who, after purchasing a super fancy car, start paying $25 for valet because they want to be seen coming in and out of their expensive cars. 5. You may have a hard time shaking off the guilt. Deep down, you know that if you're not able to pay cash for your car, then you really can't afford it at all. After I bought the SUV, each car payment was a reminder of how foolish I had been with my money. As time went by, it became clear that I was only getting poorer, not richer. I also regretted not prioritizing more important things, like saving for retirement or for my kid's college tuition. Knowing that I wasn't making any money off the car was truly an unpleasant feeling. After all, it's a well-known fact that new cars depreciate by 10% to 20% in value as soon as they're driven off the lot. (Source: Edmunds)

What to do if you spent too much on a car

If you already spent more than 10% of your gross income on a car, don't panic. Nobody is perfect, and the important thing is that you recognize your mistake and fix it right away. One option is to own your car until the market value becomes worth 10% (or less) of your gross annual income. This is the simplest solution if you've spent too much. Another option is to just bite the bullet and sell your car. This is the smartest solution if you spent more than 20% of your gross annual income on a car. (Tip: Try selling it through a free online service. I've bought and sold more than eight cars on Craigslist and have averaged 25% more than I would have gotten at the dealer.) Once you sell your car, you can use the proceeds to build passive income.

Don't rob yourself of financial freedom