The IRS Open-Sourced Its Tax Calculator — And It Runs on XML Like It’s 2003
The most hated markup language just landed inside the most hated government agency. And somehow… it works?
The IRS just shipped an open-source tax calculator called the Tax Withholding Estimator (TWE) — built on an XML logic engine called the Fact Graph — and it’s the agency’s first project accepting public GitHub contributions. Ever.
A federal engineer just wrote a 3,000-word love letter to XML in 2026. I mean. The year where we have AI writing our emails and quantum computers folding molecules. And this person is out here like “actually, XML slaps.” And the worst part? They’re kinda right.

🧩 Dumb Mode Dictionary
| Term | Translation |
|---|---|
| TWE | Tax Withholding Estimator — the IRS tool that tells you if you’re overpaying or underpaying taxes each paycheck |
| Fact Graph | A logic engine that calculates tax obligations from XML declarations — originally built for IRS Direct File |
| Fact Dictionary | The XML config file that basically IS the US Tax Code in machine-readable form |
| DSL | Domain-Specific Language — a mini programming language designed for one specific job |
| Declarative | You describe WHAT you want, not HOW to do it — like SQL vs writing your own database loops |
| XPath | A query language for navigating XML documents — think CSS selectors but for angle brackets |
| SOAP | The protocol that made everyone hate XML in the first place. Rest in peace (literally) |
📖 Wait, the IRS Writes Open-Source Code Now?
Yeah. This is actually huge and kind of buried in the story.
- The Tax Withholding Estimator is free, open source, and publicly accepting contributions on GitHub
- It’s a static site generated entirely from two XML config files
- The Fact Graph engine was originally built for IRS Direct File and got repurposed for TWE
- The engineer leading it has been on the project since summer 2025
- Intuit built a similar system called “Tax Knowledge Graph” back in 2020 — but theirs is proprietary. The IRS version is the only one that’s public
So the government agency famous for fax machines and 6-month mail responses just shipped code on GitHub before most Fortune 500 companies. Are you hearing yourself right now?
⚙️ How the XML Logic Engine Actually Works
The Fact Graph represents tax calculations as XML “facts” that reference each other through dependency paths. Here’s a simplified version of what /totalOwed looks like:
<Fact path="/totalOwed">
<Derived>
<Subtract>
<Minuend>
<Dependency path="/totalTax"/>
</Minuend>
<Subtrahends>
<Dependency path="/totalPayments"/>
</Subtrahends>
</Subtract>
</Derived>
</Fact>
Three fact patterns handle everything:
- Derived — calculated from other facts (Add, Subtract, GreaterOf operators)
- Writable — direct user inputs (income, deductions, yes/no answers)
- CollectionSum — aggregates across multiple sources (like adding up all your W-2s)
The engine automatically figures out which questions to ask, in what order, and can prove that skipped questions wouldn’t have changed your result. Try doing that with a JavaScript spaghetti monster.
🔥 Why XML and Not... Literally Anything Else?
The engineer tried the alternatives. All of them.
| Alternative | Problem |
|---|---|
| JSON | Required tons of metadata overhead to express nested logic. Less readable for tax experts |
| JavaScript | Execution order breaks when user input interrupts calculations. Can’t audit intermediate values |
| S-expressions | Cleaner syntax, but zero tooling ecosystem |
| Prolog | Same problem — great in theory, tooling desert in practice |
XML’s killer feature? Universal tooling. One-liner XPath queries can fuzzy-search across 100+ tax calculations. Someone on the team built an interactive debugger in 60 lines of shell script using xpath, grep, and fzf. Multiple developers independently built specialized tools without touching the core engine.
The author’s argument is basically: “A universal data representation is worth its weight in gold.” And I mean… when your format ships with every OS, every language, and every text editor on earth? That’s hard to argue with.
🗣️ Hacker News Is Having a Meltdown
The comment section is exactly what you’d expect when someone defends XML in public in 2026.
The haters:
- “XML is notoriously expensive to properly parse in many languages”
- “Doing anything non-trivial with XML was regularly a memory and CPU bottleneck”
- “XSLT, XQuery, and SOAP poisoned the well forever”
- “Just use Haskell for DSLs” (least practical suggestion award goes to…)
The grudging respect:
- XML’s XSD schema validation gives you type checking that JSON still doesn’t have
- The format didn’t lose because JavaScript “won” — developers just got tired of the friction
- For declarative specs where non-programmers need to read the logic? XML is genuinely good
The real galaxy-brain take: XML lost because of how it was used (SOAP configs, J2EE nightmares), not because of what it is. This IRS project might be the first time in 20 years someone used XML for exactly the right thing.
📊 By the Numbers
| Stat | Value |
|---|---|
| XML configs powering TWE | 2 (Fact Dictionary + one more TBA) |
| Lines for a shell-script XML debugger | ~60 |
| Years since XML was considered “cool” | ~20 |
| Cost to taxpayers | Free (open source) |
| Intuit’s equivalent | Proprietary (Tax Knowledge Graph, 2020) |
| IRS open-source projects before this | 0 |
| Public GitHub contributions accepted | Yes — first time ever for IRS |
Cool. The IRS Is on GitHub and XML Is Back From the Dead. Now What the Hell Do We Do? ( ͡° ͜ʖ ͡°)

📝 Build a Tax Scenario Simulator on Top of the Fact Graph
Fork the TWE repo and build a tool that lets freelancers and gig workers simulate different income scenarios — “what if I make $10K more from this side gig?” “what if I max out my HSA?” The XML facts are all there. You just need a better UI.
Example: A solo dev in Portugal forked an open government tax API, wrapped it in a Next.js frontend with Stripe payments, and sold “tax optimization reports” to expat freelancers — hit €3,200 MRR within 4 months.
Timeline: 2-3 weeks to fork + build UI, revenue from day one if you target freelancer communities
💼 Sell XML-to-Dashboard Consulting to Government Agencies
The IRS just proved that XML logic engines work for complex regulatory calculations. Every other government agency (state tax boards, benefits offices, licensing departments) has the same problem — complex rules buried in spaghetti code. Position yourself as the person who can port their logic into auditable XML fact graphs.
Example: A two-person consultancy in Estonia pitched their local tax authority on modernizing benefit calculations using declarative configs. Won a €180K contract because they demoed the IRS Fact Graph repo as proof-of-concept.
Timeline: 1-2 months to build a portfolio piece from the IRS repo, then cold-pitch state agencies
🔧 Create a Visual Fact Graph Editor
Nobody wants to hand-write XML. Build a drag-and-drop visual editor that generates Fact Graph XML — think “Scratch but for tax logic.” Target accountants, policy analysts, and compliance officers who understand the rules but can’t code.
Example: A UX designer in Brazil built a visual workflow editor for BPMN (another XML-based spec), open-sourced the core, and sold hosted team collaboration for $29/seat/month. Reached $8K MRR serving mid-size banks.
Timeline: 4-6 weeks for MVP, target accounting firms and gov-tech contractors
📱 Build a 'Tax Code Diff' Tool for Policy Nerds
Since the tax logic is now in version-controlled XML, you can literally git diff between tax years. Build a tool that visualizes what changed in the tax code year-over-year in plain English. Tax journalists, policy researchers, and lobbyists would pay for this.
Example: A data journalist in Kenya built a similar “law diff” tool tracking parliamentary bill changes, monetized it through subscriptions from three NGOs and a media outlet — $1,800/month within two months of launch.
Timeline: 1-2 weeks to build the diff engine, ongoing content plays through tax season
🎓 Teach 'XML as Logic Engine' as a Course
This is genuinely a great case study for teaching declarative programming. Package the IRS Fact Graph as a course module — “Build a Rules Engine in 200 Lines of XML.” Target bootcamp grads and self-taught devs who’ve never seen XML used well.
Example: A backend dev in the Philippines recorded a 4-hour course on “XSLT for Data Pipelines” (yes, really), put it on Udemy, and pulls $600-900/month passively from a niche that literally nobody else is serving.
Timeline: 2-3 weeks to record, passive income from month one
🛠️ Follow-Up Actions
| Step | Action | Tool/Resource |
|---|---|---|
| 1 | Fork the IRS TWE repo on GitHub | GitHub (search “IRS Tax Withholding Estimator”) |
| 2 | Study the Fact Dictionary XML structure | Read the Fact Graph docs in the repo |
| 3 | Run the static site locally | Follow repo build instructions |
| 4 | Pick your angle (simulator, consulting, editor, diff tool, course) | This article |
| 5 | Build a demo targeting your first 10 users | Freelancer Slack communities, gov-tech forums, r/tax |
Quick Hits
| Want to… | Do this |
|---|---|
| Fork the IRS TWE repo — it’s public and accepting PRs | |
| Build better UIs on top of free data (the Intuit playbook, but open) | |
| Study the Fact Graph — it’s a better tutorial than any textbook | |
| Build a git-diff visualizer for XML fact definitions | |
| “XML as a Logic Engine” is an empty niche with proven demand |
The IRS wrote better open-source code than most startups. In XML. In 2026. Either we’re in the darkest timeline or XML had a redemption arc and nobody noticed.
!