EPS is typically found on the company's income statement or financial summary.
The P/E Ratio is:
How to Calculate Price Earnings (P/E) Ratio
The Price-to-Earnings (P/E) ratio is one of the most widely used metrics for stock valuation. It tells investors how much they are paying for every $1 of a company's earnings. A high P/E might mean that a stock's price is high relative to earnings and possibly overvalued, or it could mean investors expect high growth rates in the future.
The P/E Ratio Formula
P/E Ratio = Market Value per Share / Earnings per Share (EPS)
Step-by-Step Calculation Example
Let's say a company, TechCorp, has a current stock price of $120.00. According to their latest annual report, their Earnings Per Share (EPS) was $4.00.
Identify the Price: $120.00
Identify the EPS: $4.00
Divide: $120 / $4 = 30
In this example, TechCorp has a P/E ratio of 30. This means investors are willing to pay $30 for every $1 of earnings the company generates.
Trailing vs. Forward P/E
Trailing P/E: Uses the actual earnings from the past 12 months (TTM).
Forward P/E: Uses estimated future earnings for the next 12 months. This is helpful for valuing companies that are growing rapidly.
Why is the P/E Ratio Important?
The P/E ratio allows you to compare the valuation of companies within the same industry. For example, if a software company has a P/E of 25 and the industry average is 40, the company might be undervalued. However, if the EPS is negative, the P/E ratio cannot be calculated (or is considered "N/A"), as the company is not yet profitable.
function calculatePERatio() {
var price = document.getElementById("stockPrice").value;
var eps = document.getElementById("epsValue").value;
var resultArea = document.getElementById("peResultArea");
var outputValue = document.getElementById("peValueOutput");
var interpretation = document.getElementById("peInterpretation");
// Reset display
resultArea.style.display = "none";
// Convert to numbers
var priceNum = parseFloat(price);
var epsNum = parseFloat(eps);
// Validation
if (isNaN(priceNum) || isNaN(epsNum) || priceNum <= 0) {
alert("Please enter valid positive numbers for both Price and EPS.");
return;
}
// Handle EPS <= 0 (Companies losing money)
if (epsNum <= 0) {
resultArea.style.display = "block";
outputValue.innerHTML = "N/A";
interpretation.innerHTML = "The P/E ratio is not meaningful when earnings are zero or negative (net loss).";
return;
}
// Calculation
var peRatio = priceNum / epsNum;
var formattedPE = peRatio.toFixed(2);
// Display
resultArea.style.display = "block";
outputValue.innerHTML = formattedPE + "x";
// Contextual Interpretation
var context = "";
if (peRatio = 15 && peRatio <= 25) {
context = "This is a moderate P/E ratio, typical for many established companies.";
} else {
context = "A higher P/E often indicates high growth expectations or a potentially overvalued stock.";
}
interpretation.innerHTML = context;
}