Computing a stock's price-to-earnings (P/E) ratio is one of the quickest ways to learn whether a company is overvalued or undervalued. If a company's stock is undervalued, then it may be a good investment based on the current price. If it is overvalued, then you need to evaluate whether the company's growth prospects justify the stock price.

What is the price-to-earnings ratio?

The P/E ratio measures the relationship between a company's stock price and its earnings per issued share. The P/E ratio is calculated by dividing a company's current stock price by its earnings per share (EPS). If you don't know the EPS, you can calculate it by determining the company's earnings (subtract the company's preferred dividends from its net income) and then dividing the earnings by the number of shares outstanding.

A graphic showing the definition of the P/E Ratio

P/E ratio example

Let's say a company has net income of $1 billion, it pays $200 million in preferred dividends, and it has 400 million shares outstanding. Here's how we'd calculate its EPS:

($1 billion - $200 million) / 400 million shares = $2 per share

Now that we know the EPS, we can compute the P/E ratio. If the stock currently trades for $30 per share, then the P/E ratio would simply be $30 divided by $2, or 15.

How to use the P/E ratio to evaluate stocks

When you start your analysis, take a look what type of company you're investigating. A good P/E ratio in one industry or asset class can be bad in another. If you're looking for a value stock, you want the P/E ratio to be low. The opposite is actually true of growth investments. If a company has high-flying earnings, it's likely a lot of investors will want to buy its stock.

The P/E ratio is useful, but don't rely only on this ratio for your stock purchase decisions. There are companies with low P/E ratios for which the P/E ratio will drop even more, and vice versa.

If you invert the P/E ratio, you can find out the earnings yield, which represents your share of earnings for every share you own.

P/E ratio limitations

The biggest limitation associated with the P/E ratio is the potential for earnings distortions. The earnings in earnings per share are based on the generally accepted accounting principles (GAAP) for net income, which means that GAAP-compliant earnings are not always a great indicator of the profitability of a business. If a business is adding or deducting significant non-cash expenses such as business unit sales or depreciation, then its GAAP net income can fluctuate greatly.

Capital efficiency matters, but P/E ratios don't take this factor into consideration. If a manufacturing company requires $50 in capital to produce $1 in earnings, then it shouldn't be worthy of the same ratio as a technology company that requires just $3 in capital to produce $1 in earnings.

You can compute additional ratios to make up for some of these limitations. Ratios such as enterprise value/free cash flow, price/sales (P/S) or price/book (P/B) value may be better for certain industries. Research which ratio is common to the industry before you conduct your analysis.

Comparing P/E ratios

Here are the best comparisons to use for the P/E ratio:

Peers

For the most part, competitors in an industry have similar businesses and earnings models. That means P/E ratios in the industry should be around the same, and differences to the positive likely reflect business quality or growth potential. If you think a company has a superior business but it still has a low P/E ratio, then it may be a good investment.

History

Looking at a stock's P/E ratio history is one of the best ways to avoid buying stocks with perpetually low P/E ratios. If a value stock's P/E ratio is unfavorable and has been for years, then what's the specific catalyst that will make it trade at higher prices in the future? If a growth stock is trading at its highest-ever P/E ratio, but the growth rate is starting to decline, then the stock's price may soon fall.

If a company is close to the beginning of its life cycle and is still proving out its business model, you can expect multiple expansions by the company over the coming years and may be willing to accept a high P/E ratio. If a company is a slow- or no-growth stalwart, be wary of multiple contractions and accept only low P/E ratios.

Growth

Since a company that is growing rapidly may be worth a high P/E ratio, you can compare among ratios by also calculating a company's P/E ratio as a multiple of the company's projected earnings growth rate. Simply divide a company's P/E ratio by either the earnings growth rate from the past few years or an analyst-supplied projection for the next few years. Companies with low — say, below 1 — P/E-to-earnings-growth (PEG) ratios may be worth somewhat higher P/E ratios.