Study how the IRS implemented interview-style tax filing logic using a Fact Graph data structure that works on both server and browser.
Learn how to build a system where the same business rules run on the server and in the user's browser simultaneously.
See how a government team built a State API for handing off federal return data to a third-party state filing tool.
Some government-sensitive code was removed for the public release, so certain parts of the functionality are incomplete or rewritten.
Direct File is the source code behind the IRS's free federal tax filing service, which lets Americans file their taxes directly with the IRS at no cost, without going through a third-party tax software company. The service is built to work equally well on a phone, tablet, or computer, and it is available in both English and Spanish. Instead of presenting users with blank tax forms, Direct File works as an interview: it asks plain-language questions, collects the answers, and then translates everything into the correct federal tax forms. Those answers are submitted to the IRS through an official government filing system called Modernized e-File. The questions were developed in close collaboration with IRS lawyers, so the logic reflects real tax law for the 2024 tax year. One of the more technically distinctive pieces of this codebase is something called the Fact Graph. It is a data structure written in the Scala programming language that is designed to reason about a partially completed tax return, meaning it can work with information that is still being gathered rather than requiring everything upfront. The same Fact Graph code runs on IRS servers and also in the user's browser, which keeps the experience consistent. Direct File also helps users handle state taxes, even though it only files federal returns itself. After completing a federal return, users can optionally send their data to a third-party state filing tool through a State API, so they do not have to type everything in a second time. The project was built by an in-house team at the IRS, with support from the U.S. Digital Service, the General Services Administration, and several vendor partners. Some code from the original development was not included in this public repository because it contains sensitive government information, so certain parts of the functionality have been removed or rewritten for the public release.
← irs-public on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.