Price to Earnings Growth Ratio (PEG)
Calculate the price earnings to growth (PEG) ratio, a valuation metric that measures the ratio of the price-to-earnings ratio to earnings growth rate.
The price-to-earnings growth (PEG) ratio provides a more comprehensive valuation measure compared to the P/E ratio alone. It takes into account a company’s earnings growth rate, allowing investors to assess whether a stock is overvalued or undervalued relative to its growth prospects.
The formula is as follows:
\[\text{Price Earnings to Growth Ratio} (\text{PEG}) = \text{Price Earnings Ratio} (P / E) / (\text{EPS Growth Rate} \cdot 100)\]The growth rate is the growth of the (diluted) earnings per share on the previous year, or of EBITDA when use_ebitda_growth_rate is True, multiplied by 100 so that it enters in percent. With quarterly data both the P/E and the growth use trailing twelve month figures, and the growth compares them with those of four quarters earlier.
A PEG around 1 is the traditional rule of thumb for a growth stock priced in line with its growth. This historical PEG uses a single period of earnings growth, so it swings widely, explodes when earnings barely grow and turns negative when they fall, which is why practitioners prefer forward or multi-year growth (get_forward_price_earnings_growth_ratio) and leave negative values out of comparisons.
Also known as: PEG ratio, price earnings growth.
Price to Earnings Growth Ratio (PEG) in Python or via the MCP
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_price_to_earnings_growth_ratio as shown below.
from financetoolkit import Toolkit
toolkit = Toolkit(
["MA", "ADP", "COST"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2021-01-01",
end_date="2025-12-31",
)
toolkit.ratios.get_price_to_earnings_growth_ratio()
Or, after setting up the Finance Toolkit MCP, ask:
What were the PEG ratios of Mastercard, ADP and Costco from 2021 to 2025?
Which returns:
| 2021 | 2022 | 2023 | 2024 | 2025 | |
|---|---|---|---|---|---|
| ADP | 6.2692 | 2.2192 | 1.6493 | 2.9504 | 2.6649 |
| COST | 2.016 | 2.0916 | 6.0241 | 3.2539 | 4.7694 |
| MA | 1.0968 | 2.0264 | 2.2927 | 2.1854 | 1.7108 |
Parameters
get_price_to_earnings_growth_ratio accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
use_ebitda_growth_rate | bool | Whether to use EBITDA growth rate for the calculation. Defaults to False. | True |
include_dividends | bool | Whether to deduct preferred dividends from net income, in both the P/E and the EPS growth (not in the EBITDA growth). Defaults to False. | True |
diluted | bool | Whether to use diluted shares in the calculation. Defaults to True. | False |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise). | 2 |
growth | bool | Whether to calculate the growth of the ratios. Defaults to False. | True |
lag | int | list[int] | The lag to use for the growth calculation. Defaults to 1. | 4 |
compound | bool | Whether the growth is the compound annual growth rate over the lag (e.g. lag=5 for the five-year CAGR) instead of the total change. Defaults to False. | False |
standardize | bool | Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False. | True |