# Show HN: Every site gives a different P/E ratio, so I open-sourced the math

> Source: <https://github.com/JerBouma/FinanceToolkit>
> Published: 2026-06-26 06:13:19+00:00

Microsoft's P/E on May 6, 2023: Stockopedia says 28.93, Morningstar 32.05, Macrotrends 32.66, Yahoo Finance 33.80, Companies Market Cap 34.4. Same company, same date, eight different numbers. The usual causes: trailing-twelve-month vs fiscal-year-end earnings, diluted vs basic shares, different treatment of extraordinary items. Most providers don't document which they use. In the meantime, I report it at 32.07 (diluted), 31.96 (non-diluted), 30.07 (TTM diluted) and 29.93 (TTM non-diluted).

That is why I built the Finance Toolkit: an open-source (MIT) Python library where every one of 200+ metrics has its formula in the source. Entirely free to use and includes a MCP server as well.

Comments URL: [https://news.ycombinator.com/item?id=48682935](https://news.ycombinator.com/item?id=48682935)

Points: 1

# Comments: 0
