OpenTax Engine is an open-source US federal tax calculator that provides exact, verifiable answers with proof trees citing specific statutes, designed for AI agent integration and offline verification.

Stars

119

7-day growth

No data

Forks

19

Open issues

0

License

AGPL-3.0

Last updated

2026-07-27

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It combines exact bigint-cent arithmetic, a full rule corpus for 2025 and 2026 tax years, a solver layer for cliffs and marginal rates, and independent validation against PolicyEngine, all while never guessing—only deriving from encoded rules.

Who it is for

  • Tax software developers integrating proof-based tax computation into applications
  • AI engineers building LLM agents that require reliable tax figures without hallucination
  • Tax professionals and policymakers who need auditable, citation-backed calculations
  • Open-source contributors extending tax rule coverage via data-driven contributions

Use cases

  • Agent-based tax preparation: LLM calls the engine via MCP tools for accurate answers
  • Guardrail for AI-generated tax figures: `opentax check` refutes wrong claims with the correct value
  • Policy simulation and education: explore marginal rates, cliffs, and compare filing statuses
  • Offline tax verification: run in a browser with a self-contained HTML file, verify proofs without network

Strengths

  • Exact to the cent using bigint arithmetic with no floating point errors
  • Verifiable proof trees that cite specific statutory references (e.g., 26 U.S.C. § 63)
  • Covers all five filing statuses, hundreds of credits/deductions, and both 2025 and 2026 law
  • Independently validated against PolicyEngine with 533 of 572 scenarios agreeing exactly

Considerations

  • Some approximations: earned income ≈ wages, MAGI ≈ AGI in several phase-outs
  • EITC qualifying children approximated by CTC child count; niche interactions may refuse outright
  • State returns only partially covered (IL/VA/CA/NY/PA via MCP), and some areas (consolidated returns, REIT/RIC) refuse explicitly

README quick start

opentax-engine

A US tax calculator that shows its work — and can prove it.

Three ideas, that's the whole project:

  1. Ask it a tax question with plain facts (--wages 50000).
  2. It answers with a proof: every rule it applied, with the law it came from (26 U.S.C. § 63(c) …), every assumption it made.
  3. Anyone can verify that proof offline. If it can't derive an answer from its encoded rules, it refuses — it never guesses.

Open source (AGPL-3.0, with commercial licenses available), exact to the cent (no floating point), built to be extended.

Try it

pnpm install && pnpm build
pnpm opentax eval --status mfj --wages 120000 --kids 2
us.federal.income_tax_after_credits  $5,640.00
├─ us.federal.income_tax_before_credits  $10,040.00   [26 U.S.C. § 1(j); Rev. Proc. 2025-32]
│  └─ us.federal.taxable_income  $87,800.00           [26 U.S.C. § 63(b)]
│     ├─ us.federal.agi  $120,000.00
│     │     ├─ fact wages = $120,000.00
│     │     └─ assumed taxableInterest = $0.00 (default)
│     └─ us.federal.standard_deduction  $32,200.00    [Rev. Proc. 2025-32 § 4.14]
└─ us.federal.ctc  $4,400.00                          [§ 24, as amended by OBBBA § 70104]

Assumptions (6): taxableInterest = $0.00, isAge65OrOlder = false, …
corpus sha256:6ff44719…

It answers under the law in force on the date you ask about--as-of defaults to today; pass --as-of 2025-12-31 and the same facts derive under TY2025 rules instead (different standard deduction, different brackets, cited to the other Rev. Proc.).

Money is written in dollars (50000, "$50,000", "1234.56"). Not sure what inputs exist? pnpm opentax facts lists them all. More facts than fit in flags? Use a JSON file: --facts examples/mfj_120k_2kids.json.

Or skip the terminal entirely — the engine is pure TypeScript with zero platform dependencies, so the whole thing runs in a browser:

pnpm -F @invaro/opentax-playground build && open packages/playground/dist/index.html

One 130 KiB self-contained HTML file: engine + full rule corpus + verifier, no server, no network, works from file://. Compute, read the proof tree, download the proof — then paste it into the Verify tab and watch your own browser re-derive every step (alter one byte and it says exactly what broke). Same corpus Merkle root the CLI prints.

Save a proof, verify a proof:

Description

The deterministic tax engine for AI agents. Highest score ever recorded on TaxCalcBench (96% exact returns)

Related repositories

Similar projects matched by category, topics, and programming language.

react
Featured
react GitHub avatar

react

React is a JavaScript library for building user interfaces with declarative, component-based, and cross-platform design.

Web DevelopmentFrontend Frameworks
246,741
tandpfun
Featured
tandpfun GitHub avatar

wardrobe

A GPT‑image powered app that extracts individual garment cutouts from photos, organizes them into a digital wardrobe, and generates modeled outfit previews.

JavaScript
1,570
mshumer
Featured
mshumer GitHub avatar

Claude-of-Duty

A browser-based first-person shooter built entirely with procedural generation and orchestrated AI agents, featuring 55k lines of Three.js/WebGL2 code and no art assets.

AI & Machine LearningAI Agents
1,234