When valuing a stock, I have to be careful to avoid falling for value traps that seem cheap just because they are trading at low multiples to earnings, cash flows, or book value. That said, at any price, a stock implies a certain level of future cash flows above which an investor will make money, and below which the investor will not, at least relative to simply earning interest on the same money in bank deposits. The textbook calculation for this is a “discounted cash flow” (DCF) analysis, and so I thought it would be handy to share here a quick and dirty javascript version of a DCF calculator. The DCF calculator inputs are:

- The cash earnings per share (CEPS) expected for the first upcoming year
- The number of years until these cash earnings plateau
- The level at which these cash earnings per share plateau, and
- A uniform discount rate at which to discount these cash flows.

I have hardcoded the assumption that these cash flows will be projected and discounted out 30 years, then ignored after that. Let me know in the comments if you find this tool useful, or have found a better one elsewhere.

As always, **this blog post and the below calculator are for illustration and discussion purposes only, and are not tax advice of any kind.**

## Simple DCF calculator

First year CEPS: | |

Number of years to plateau: | |

Plateau CEPS: | |

Discount rate: | |

Saving now vs later: which adds up to more? |

Age | Base | PlusOne |

45 | 100 | 101 |

Test