Brazil's federal tax agency is giving away its homework. The Receita Federal has published the code for its new consumption-tax calculator on GitHub under the MIT license, one of the most permissive open-source licenses there is, so any company or developer can copy it, change it and build it into their own software.
The Receita Federal's GitHub organization lists three public repositories, all marked MIT. As read on November 21, 2026, the main calculator had 850 stars and 214 forks, the version for small businesses had 635 stars and 158 forks, and a third project, written in Go, had 508 stars and 144 forks.
What the calculator does
The code exists because Brazil is rebuilding how it taxes what people buy. According to Wikipedia's overview of the Brazilian tax reform, five older taxes (PIS, Cofins, IPI, ICMS and ISS) are being replaced by a dual value-added tax: the federal CBS and the IBS, run jointly by states and municipalities. The changeover runs from 2026 to 2033, and 2026 is a test year with a combined trial rate of 1%.
That kind of switch is a nightmare for billing software, which has to get every line on every invoice right. The main repository's README describes a REST API that calculates CBS, IBS and the new Selective Tax for companies in the regular regime under Complementary Law 214/2025. It also serves the official tables used in the math, including product codes and reference rates for the federal government, states and cities, and it generates and checks the tax sections of Brazil's electronic invoices against the official XML schemas.
A second repository does the same job for the Simples Nacional, Brazil's simplified regime for small businesses. The Simples Nacional calculator's README says it covers CBS and IBS for that regime and borrows its database scripts from the main project. The third repository, per its name, generates DANFSe, the printable summary that accompanies an electronic service invoice.
How a developer would use it
Both calculators are written in Java and require Java 25. They run on Spring Boot with an embedded SQLite database that Flyway builds on first setup, and they publish interactive API documentation through Swagger. The READMEs list the intended users as tech companies, developers and taxpayers in general, and both include instructions for Windows, macOS and Linux.
In practice that means an accounting startup or an in-house IT team can run the government's own calculation engine on its servers instead of writing tax logic from scratch and hoping it matches. The MIT license allows commercial use, as long as the copyright and license notice travel with the code.
Why open code from a tax office stands out
Tax authorities usually publish rules as legal text and leave software vendors to interpret them. By shipping the calculator itself, the Receita Federal gives every vendor the same reference implementation. Each repository also carries governance files, a contributing guide, a roadmap, a security policy and a changelog, the standard furniture of a maintained open-source project rather than a one-off code dump.
The repositories were last updated on November 19 for the two Java calculators and October 27 for the Go project. Developers outside Brazil may simply find it a clean example of how a government can publish working code alongside the law it implements. For more on open code that ended up everywhere, see Badiyaa's story on ggml, the library behind llama.cpp, reaching version 1.0, and why Vint Cerf says TCP/IP was never patented.
Sources
- Receita Federal do Brasil on GitHub, Receita Federal do Brasil, 2026
- Brazilian tax reform, Wikipedia, 2026
- calculadora-rtc-regime-regular (README), Receita Federal do Brasil, 2026
- calculadora-rtc-simples-nacional (README), Receita Federal do Brasil, 2026
Image: Senado Federal, CC BY 2.0 via Wikimedia Commons
This article was produced with AI assistance and reviewed by our Editorial Desk. How we work.




