Skip to content

Calculating Free Cash Flow

Ray Garcia edited this page Jul 23, 2023 · 16 revisions

Free cash flow is a financial metric that measures the amount of cash a company generates from its operations after deducting all its expenses and investments. It's an important indicator of a company's financial health and can provide valuable insights for investors. Here are the benefits of free cash flow and how to calculate it:

Benefits of Free Cash Flow:

  • Financial Flexibility: Free cash flow gives a company the ability to pursue growth opportunities, pay off debts, and distribute dividends to shareholders.

  • Investment Potential: Positive free cash flow indicates that a company has the resources to invest in research and development, acquisitions, or other projects that can lead to future growth.

  • Stability: Consistently generating free cash flow demonstrates the stability and sustainability of a company's operations.

Calculation of Free Cash Flow:

Free Cash Flow (FCF) is calculated by subtracting capital expenditures (money spent on acquiring or maintaining assets) from operating cash flow (cash generated from day-to-day operations). The formula is as follows:

FCF = Operating Cash Flow - Capital Expenditures

Operating Cash Flow: It represents the cash generated from the company's core operations. It includes revenue from sales, minus expenses such as salaries, taxes, and operating costs.

Capital Expenditures: This refers to the amount of money a company spends on purchasing or maintaining assets like equipment, buildings, or machinery. It represents the investments made by the company.

Code Example

from alphavantage_api_client import AlphavantageClient, AccountingReport
import logging
from decimal import Decimal

def calculate_free_cash_flow_last_fiscal_year():
    client = AlphavantageClient()
    symbol = "TSLA"
    one_billion = Decimal(1000000000.00) # just make the numbers smaller and easier to read :-)
    cash_flow_statements = client.get_cash_flow(symbol)
    last_year_cash_flow_statement = cash_flow_statements.get_most_recent_annual_report()
    last_year_fcf = calc_free_cash_flow(last_year_cash_flow_statement, one_billion)
    fiscalDateEnding = last_year_cash_flow_statement.get('fiscalDateEnding', 'Not Provided')
    print(f"FCF as of {fiscalDateEnding} for {symbol} was ${last_year_fcf}b")


def calc_free_cash_flow(free_cash_flow_statement: dict, multiple: Decimal) -> Decimal:
    capitalExpenditures = free_cash_flow_statement.get('capitalExpenditures', Decimal('0.00'))
    capitalExpenditures = Decimal(capitalExpenditures) / multiple

    operatingCashflow = free_cash_flow_statement.get('operatingCashflow', Decimal('0.00'))
    operatingCashflow = Decimal(operatingCashflow) / multiple

    free_cash_flow = operatingCashflow - capitalExpenditures
    print(f"operatingCashflow = ${operatingCashflow}b, capitalExpenditures = ${capitalExpenditures}b ")


    return free_cash_flow

if __name__ == "__main__":
    calculate_free_cash_flow_last_fiscal_year()

Produces output


operatingCashflow = $14.724b, capitalExpenditures = $7.158b 
FCF as of 2022-12-31 for TSLA was $7.566b

Process finished with exit code 0

Free Cash Flow per Share:

Free Cash Flow per Share is a variation of free cash flow that indicates the amount of cash a company generates for each outstanding share of its stock. It is calculated by dividing the free cash flow by the number of outstanding shares. This metric helps investors assess the value they receive for each share they own.

FCF per Share = Free Cash Flow / Number of Outstanding Shares

Code example

from alphavantage_api_client import AlphavantageClient, AccountingReport, CompanyOverview
import logging
from decimal import Decimal

def calc_free_cash_flow(free_cash_flow_statement: dict, multiple: Decimal = Decimal(1)) -> Decimal:
    capitalExpenditures = free_cash_flow_statement.get('capitalExpenditures', Decimal('0.00'))
    capitalExpenditures = Decimal(capitalExpenditures) / multiple

    operatingCashflow = free_cash_flow_statement.get('operatingCashflow', Decimal('0.00'))
    operatingCashflow = Decimal(operatingCashflow) / multiple

    free_cash_flow = operatingCashflow - capitalExpenditures
    print(f"operatingCashflow = ${operatingCashflow}b, capitalExpenditures = ${capitalExpenditures}b ")


    return free_cash_flow

def calc_free_cash_flow_per_share():
    client = AlphavantageClient()
    symbol = "TSLA"
    one_billion = Decimal(1000000000.00) # just make the numbers smaller and easier to read :-)
    cash_flow_statements = client.get_cash_flow(symbol)
    last_year_cash_flow_statement = cash_flow_statements.get_most_recent_annual_report()
    last_year_fcf = calc_free_cash_flow(last_year_cash_flow_statement, one_billion)
    fiscalDateEnding = last_year_cash_flow_statement.get('fiscalDateEnding', 'Not Provided')
    print(f"FCF as of {fiscalDateEnding} for {symbol} was ${last_year_fcf}b")

    # get shares outstanding
    company_overview = client.get_company_overview("tsla")
    shares_outstanding = Decimal(company_overview.shares_outstanding) / one_billion # just make the numbers smaller and easier to read :-)
    fcf_per_share = round(last_year_fcf / shares_outstanding, 2)
    print(f"Free Cash Flow per share for {symbol} was ${fcf_per_share} having shares outstanding of {shares_outstanding}b")

if __name__ == "__main__":
    calc_free_cash_flow_per_share()

Produces output

operatingCashflow = $14.724b, capitalExpenditures = $7.158b 
FCF as of 2022-12-31 for TSLA was $7.566b
Free Cash Flow per share for TSLA was $2.39 having shares outstanding of 3.1695b

Process finished with exit code 0

Conclusion

By calculating free cash flow and free cash flow per share, investors can evaluate a company's ability to generate cash, its financial strength, and its potential for future growth.