Calculate the debt to equity ratio, a solvency ratio that measures the proportion of a company’s equity that is financed by debt. This ratio is also known as the Gearing Ratio.

The debt to equity ratio, for short the D/E ratio, indicates the relative contribution of debt and equity to a company’s capital structure. It helps assess the level of financial risk a company carries due to its debt obligations. A higher ratio implies a higher reliance on debt to finance the business, which could increase risk but also potentially lead to higher returns for shareholders.

The formula is as follows:

\[\text{Debt to Equity Ratio} = \text{Total Debt} / \text{Total Equity}\]

The debt to equity ratio is compared within an industry, since utilities, real estate and companies with a financing arm (car makers, machinery makers) carry far more debt than software companies. Equity is a book value, so large buybacks or accumulated losses can make it small or negative, and the ratio then becomes extreme or negative without saying anything about the debt load; the debt to capital ratio (get_debt_to_capital_ratio) and net debt to EBITDA (get_net_debt_to_ebitda_ratio) are more robust in those cases.

Also known as: D/E ratio, leverage ratio, gearing ratio.

Debt to Equity Ratio in Python or via the MCP

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_debt_to_equity_ratio as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["CAT", "DE", "CNH"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2021-01-01",
    end_date="2025-12-31",
)

toolkit.ratios.get_debt_to_equity_ratio()

Or, after setting up the Finance Toolkit MCP, ask:

How much debt did Caterpillar, Deere and CNH Industrial carry per dollar of equity from 2021 to 2025?

Which returns:

  2021 2022 2023 2024 2025
CAT 2.288 2.3279 1.9422 1.9703 2.0326
CNH 4.5462 3.3243 3.3897 3.4969 3.4548
DE 2.6435 2.5643 2.9102 2.8555 2.4584

Parameters

get_debt_to_equity_ratio accepts the following parameters.

ParameterTypeDescriptionExample
roundingint | NoneThe number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise).2
growthboolWhether to calculate the growth of the ratios. Defaults to False.True
lagint | list[int]The lag to use for the growth calculation. Defaults to 1.4
compoundboolWhether 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
standardizeboolWhether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False.True
trailingintThe number of periods to sum flows (income and cash flow statement items) over, with balance sheet items averaged over the same number of period ends. E.g. 4 with quarterly data gives the trailing twelve months (TTM) and 3 with annual data a three-year cumulative figure. Defaults to None, which uses single-period flows (per quarter and not annualized with quarterly data).4
Share