Ever wonder how to calculate a price-to-earnings (P/E) ratio? It's probably simpler than you think. The P/E ratio is a measure that compares a company's stock price to its earnings per share (EPS) for the previous 12 months. You can think of it as a fraction, with the stock price on top and EPS on the bottom. Alternatively, tap the price into your calculator, divide by EPS, and voila -- the P/E.

Consider Wanton Punctuation (ticker: ?#$@!), trading at $30 per share. If its EPS for the last year (adding up the last four quarters reported) is $1.50, you just divide $30 by $1.50 to get a P/E ratio of 20. Note that if the EPS rises and the stock price stays steady, the P/E will fall -- and vice versa. For example, a stock price of $30 and an EPS of $3 yields a P/E of 10. You can calculate P/E ratios based on EPS for last year, this year, or future years.

Since published P/E ratios generally represent a stock's current price divided by its past four quarters of earnings, they reflect past performance. Intelligent investors should really be focusing on future prospects. You can do that by calculating forward-looking P/E ratios. Simply divide the current stock price by the coming year's expected earnings.

Many investors seek companies with low P/E ratios, as this can indicate beaten-down companies likely to rebound. (Of course, a low P/E may also indicate a beaten-down company that's just begun its beating.) Low P/Es might be attractive, but understand that P/Es vary by industry. Car manufacturers and banks typically sport low P/Es, while software and Internet-related companies command higher ones. Don't compare kumquats to kiwis and don't stop with the P/E ratio -- there are many other numbers to examine when studying a stock.

Learn more about how to make sense of financial statements in our "Crack the Code: Read Financial Statements Like a Pro" how-to guide. Give any of our how-to guides a whirl -- your satisfaction is guaranteed, or you get your money back.

And if you're looking for undervalued stocks, take advantage of a free trial of our Inside Value newsletter, and in addition to several in-depth stock recommendations, you'll be able to peek at a long list of all our recently recommended value stocks.