The three major credit reporting bureaus all use a similar formula based on the Fair Isaacs formula, a proprietary mathematical algorithm that spits out your credit score number based on a bunch of information about you. The math part is not really what you need to know, though. What you need to know is what information goes into making your score and what type of information is the most important for your score.
Basically, your credit score is based on information about your entire financial life, including your debt, payments, and open accounts. The information that goes into your score, though, is weighed. This means that some categories count for more than others. Here is a breakdown of how the credit bureaus weight information, in general, to obtain your credit score.
The largest chunk of your credit score is based on the way you pay your bills. About 35% of your score is based on this information. Recent information counts for more here, but older information counts, too, especially if it's something like a bankruptcy. It takes some time for missed payments, collection's notices, and bankruptcies to fall off your credit report, so these things may take some living down if you've been through them.
Next most important on the list at 30% of your score is your debt to credit ratio. This is the amount of money you owe versus the amount of money you're allowed to borrow based on things like credit cards and lines of credit. The lower your debt compared with your credit, the better off you're going to be in this category.
15% of your credit score has to do with the length of your credit history. The longer you've had good credit, especially credit in good standing, the more you're going to get in this category. This is why you do not want to close your old account after you've paid it off, necessarily.
Next, 10% of your score goes to each of two categories: mix of credit and recent inquiries on your report. It's a good thing to have credit from different things, such as a car, a credit card, and a mortgage. It's also a good idea to keep inquiries for your credit report low. If a lot of people are asking for your score, lenders will assume you're getting ready to take out more loans, which makes you a higher risk client.