explaingit

irs-public/direct-file

4,566JavaScriptAudience · developerComplexity · 5/5Setup · hard

TLDR

The open-source code behind the IRS's free federal tax filing service, which guides Americans through their taxes as a plain-language interview and submits the result directly to the IRS, no third-party tax software needed.

Mindmap

mindmap
  root((direct-file))
    What it does
      Interview-style tax filing
      Submits to IRS e-File
      State tax handoff
    Tech Stack
      JavaScript
      Scala
      Fact Graph
    Use Cases
      Free federal filing
      Study govt codebases
      Tax logic research
    Audience
      Developers
      Policy researchers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Study how the IRS implemented interview-style tax filing logic using a Fact Graph data structure that works on both server and browser.

USE CASE 2

Learn how to build a system where the same business rules run on the server and in the user's browser simultaneously.

USE CASE 3

See how a government team built a State API for handing off federal return data to a third-party state filing tool.

Tech stack

JavaScriptScalaJava

Getting it running

Difficulty · hard Time to first run · 1day+

Some government-sensitive code was removed for the public release, so certain parts of the functionality are incomplete or rewritten.

In plain English

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.

Copy-paste prompts

Prompt 1
I'm exploring the IRS direct-file codebase. Explain how the Fact Graph written in Scala works and how it reasons about a partially completed tax return.
Prompt 2
Using the direct-file repo, show me how the State API integration works, how does it hand off federal return data to a state tax filing tool without the user re-entering information?
Prompt 3
Walk me through how a user's interview answers in direct-file get translated into the correct federal tax form fields.
Prompt 4
How does direct-file run the same Fact Graph logic on both the IRS server and in the user's browser at the same time?
Open on GitHub → Explain another repo

← irs-public on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.