If you are thinking about buying a car in 2012, now is the time to do some planning, so you'll be fully prepared when it comes time to make your purchase. Whether you end up buying a new or used car, chances are it will be the second most expensive item you own next to your home, so it makes financial sense to avoid any snap decisions. Here are 12 tips to ensure you buy an affordable car.

Tip 1: Determine your budget

Determining what you can afford, not just for the car itself but for all ownership costs, is important before you settle on a certain make or model. Though spending no more than 20% of your monthly household income on all the cars in your household is a general rule of thumb, you may be able to afford more or less.

Bankrate's home budget calculator will help you calculate how much you can afford to spend. Keep in mind this number should cover all costs, including monthly payments, insurance, fuel, repairs and maintenance.

Tip 2: Narrow your car choices

You've probably already started noticing cars that interest you. Make note of them and start researching them online at the automakers' websites and third-party vehicle information sites. Make sure your research includes assessing all of the car's features that are important to you as well as invoice and retail prices. Keep a file of your research, but don't head off to a dealership for a test drive just yet.

Tip 3: Decide on new or used

Don't assume you'll get the most bang for your buck buying a used car. Used cars are in high demand and are more expensive than ever, while many new cars have substantial rebates and other "perks" such as free maintenance and roadside assistance.

With used cars, you let someone else take the initial depreciation hit, while with new cars, you have the benefit of the full factory warranty. Sometimes certified pre-owned cars offer the best of both worlds: a car that's already experienced the bulk of its depreciation yet has a longer warranty.

Tip 4: Check cost of ownership

To determine if the cars on your short list are within your budget, check the ownership costs for each car. This information is available at third-party vehicle information sites. But keep in mind the ownership costs on these sites are averages. Your actual costs, especially for fuel and insurance, may vary greatly.

Call your insurance agent to get a quote for the cars using your current coverage as a gauge, and do the math on your fuel costs based on the average price of gas in your area and the typical number of miles you drive.

Tip 5: Check the car's history

Every car has a history, and you should know it. For new and used cars, check the model's reliability ratings to get an idea of how much you'll spend on repairs as well as how often you may find yourself bringing those cars in for service. For used cars, run a vehicle history report using the car's vehicle identification number, or VIN, to see if the car has any red flags, such as a serious accident, a lemon buyback or flood damage.

Tip 6: Shop around for a lender

Don't wait until you are in the dealership office to figure out financing. Use Bankrate's rate search tool to see current interest rates nationwide. Also, check with local lenders, including credit unions, which are often 1% to 2% less than conventional banks.

There are now many community credit unions open to anyone living in their area, eliminating the need to work at a certain company to join. With credit loosening, blank-check auto loans -- or prearranged financing -- are being offered more widely, and they allow you to negotiate without wondering about your interest rate.