Price-to-earnings ratio
A price-to-earnings ratio compares a company’s or stock’s market price with its earnings per share.
Investing for Programmers
A price-to-earnings ratio is a valuation ratio comparing a company's share price with its earnings per share.
- How it is used
- Uses P/E to assess stock valuation while building investment vocabulary and comparing companies.
- How deep it goes
- Defines the formula, compares baselines, distinguishes trailing and forward values, and defers complete judgment to broader analysis.
- Examples
- Uses NVIDIA, Pfizer, Walmart, Apple, Sempra, and Coca-Cola comparisons plus sector medians and historical averages.
- What you can do after
- Evaluate relative valuation with P/E, PEG, sector benchmarks, peer comparisons, and historical context without treating one ratio as decisive.
Read how Investing for Programmers explains price-to-earnings ratio →
Build a Robo-Advisor with Python (From Scratch)
A valuation ratio comparing a stock's market price with its earnings per share.
- How it is used
- Uses valuation changes to adjust historical stock-return estimates.
- How deep it goes
- Defines standard P/E through its earnings input, contrasts CAPE, and applies the adjusted measure in a regression workflow.
- Examples
- Uses VFINX stock returns, CAPE percentage changes, and regression of excess returns on valuation changes.
- What you can do after
- Evaluate how changing equity valuations may affect historical-return estimates.
Read how Build a Robo-Advisor with Python (From Scratch) explains price-to-earnings ratio →
What to know first
- stockStock is a financial security representing an ownership interest in a company, often divided into shares that may confer economic or governance rights.
Related concepts
- cyclically adjusted price-to-earnings ratiocontrasts with · The cyclically adjusted price-to-earnings ratio is a valuation metric that divides an asset's price by its average inflation-adjusted earnings over the preceding ten years.
- earnings per sharemeasures · Earnings per share is a company’s net income attributable to common shareholders divided by its outstanding common shares.
- price/earnings-to-growth ratioused by · A price/earnings-to-growth ratio compares a company’s price-to-earnings ratio with its earnings growth rate.
- ratiokind of · A ratio is a quantitative comparison of two quantities expressed through their relative sizes or quotient.
- financial ratiokind of · A financial ratio is a quantitative relationship between financial statement values used to evaluate financial condition, performance, or valuation.
Questions about price-to-earnings ratio
What is price-to-earnings ratio?
A price-to-earnings ratio compares a company’s or stock’s market price with its earnings per share.
Which Manning books explain price-to-earnings ratio?
Investing for Programmers and Build a Robo-Advisor with Python (From Scratch).
What should I know before learning price-to-earnings ratio?
Manning books that teach price-to-earnings ratio usually introduce stock first.
What is the difference between price-to-earnings ratio and cyclically adjusted price-to-earnings ratio?
A price-to-earnings ratio compares a company’s or stock’s market price with its earnings per share. The cyclically adjusted price-to-earnings ratio is a valuation metric that divides an asset's price by its average inflation-adjusted earnings over the preceding ten years.
What is price-to-earnings ratio a kind of?
Price-to-earnings ratio is a kind of ratio. A ratio is a quantitative comparison of two quantities expressed through their relative sizes or quotient.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

