Brazil's tax authority open-sources its tax calculator on GitHub under MIT (gov.br)
588 points by dvaplima 4 days ago
usr1106 8 hours ago
Every country that calls itself democratic and free should open-source such software.
No need to support evil giants, it's enough to host it elsewhere.
trescenzi 7 hours ago
The US was working towards this and then it was one of the first things taken down by DOGE.
https://www.wired.com/story/doge-direct-file-chopping-block/
ufo 5 hours ago
A technicality: what is being open sourced here are the formulas used to compute value-added tax and other forms of business tax that were affected by the recent tax reform.
Although the Brazilian tax authority does develop software to file personal income tax, and provides it free of charge, that software is currently not open source.
newyankee 3 hours ago
xbmcuser 5 hours ago
maerF0x0 2 minutes ago
It was also Intuit lobbying
alansaber 6 hours ago
Yes, they killed direct file, the motivations are fairly blatant. Open source makes so much sense for this, you can check it and raise issues, raised a few issues for the IRS repos myself (obviously, they were pretty fringe, but this will matter for n=few hundred people)
carlosjobim 6 hours ago
Caarticles 2 hours ago
I mean, you can still file your taxes with pen & paper, using public information and snail mail. But I fear the day when we’re all forced to use some clunky software owned by a shady private company, entering sensitive data and selfies on our smartphones, with no idea where it’s being stored. I’d be happy if the government just left the current system alone before making it even worse.
FranzFerdiNaN 6 hours ago
It’s so bizarre that the US government doesn’t provide a way to do your taxes. At least for citizens.
I live in the Netherlands and the Dutch IRS provides everything I need to do my yearly taxes. Hell they fill in a whole lot of numbers automatically based on what they know about my salary from my employer. Before I owned my own home my yearly taxes took literally five minutes to fill in because of that. Just double checked some pre-filled numbers and done.
toddmorey 6 hours ago
chii 7 hours ago
penny wise pound foolish. This is so unfortunate.
kasey_junk 7 hours ago
Ylpertnodi 7 hours ago
It's ok, Elon's a lefty now.
ivan_gammel 8 hours ago
Yes. Proprietary software that people are forced to use to access government services is a hidden tax. In 2026 the scope of automation is big enough for the governments to maintain in-house engineering teams and use every opportunity including open-sourcing to build better software at lower costs. Today we probably don’t even need to put them in non-profits or subsidiary companies to avoid government salary caps. There are enough people on the market looking for jobs.
cassianoleal 7 hours ago
> Proprietary software that people are forced to use to access government services is a hidden tax.
In Brazil, this software has been made available for free by the Government for at least 25 years. I say this because that's around when I started using it. It was like that for a lot longer. Versions for Linux, Mac and Windows.
What's different now is that they've open sourced it. Great move, and I highly support it! That said, it makes no difference in terms of cost to use the software.
marcodiego 7 hours ago
wouldbecouldbe 8 hours ago
I did lot of open sourcing for city governments, but it brings more cost then keeping it internal due to presenting it, docs, meetings etc. Now some people claim you should do those things anyway but not to the same extent
tancop 3 hours ago
retwakm4 7 hours ago
tekla 8 hours ago
> forced to use to access government services is a hidden tax.
Describe. What is anyone forced to use.
ivan_gammel 7 hours ago
_3u10 6 hours ago
Yes the real problem with US taxation is TurboTax. Excellent analysis.
rib3ye 4 hours ago
I recently learned about PIX and was kinda blown away we don't know there is a tidal wave of work being done to displace American payment processors outside the U.S.
toast0 24 minutes ago
Central bank supported payment just makes a ton of sense for a country.
a) why pay foreign service providers x% of all card based transactions. It's not the whole merchant discount because a lot of that goes to the issuing bank, but it's still significant.
b) if the user/merchant costs are low enough, it displaces cash and helps to formalize the economy which means more accurate economic reporting and less tax evasion.
c) maybe you can provide payment services or software to smaller countries for a while
evandrofisico an hour ago
From the linked page: >You can buy a car or a house with Pix in seconds.
Yep, one day this year I bought fruits on the supermarket with nfc pix and later the same day I bought an electric car with pix. It's like living in the future with no fees being transferred to the USA.
ezbie an hour ago
That doesn't mean Brazil does what you say. Back in the 2000s Brazil was runnning in that direction, everything public was incorporating OSS and I myself participated/used several public services that were built upon Linux. Then at some point in the 2010s they announced they'd be doing away with that philosophy and suddenly their started getting volume licenses and sticking windows/office on every school, university or government computer again.
cowlevel an hour ago
Why isn't publishing the formulas sufficient for democracy and freedom?
nayuki an hour ago
Have you tried filling out government tax forms? The math and logic (e.g. if-else) are described in natural language prose (e.g. English), not standard mathematical formula notation. And because of that, there are stylistic variations in how operations are described, and there are ambiguities sometimes and even things that you have to infer (e.g. certain amounts that cannot be negative, when to round numbers). And then there are fields that cross-reference other fields and you have to fetch those values manually too. All of this is much better described in a formal, executable, popular programming language like Python, JavaScript, C, etc.
cowlevel 21 minutes ago
ffaccount2 8 hours ago
I mean in my country government does the taxes for me, I just need to accept their calculation (or do nothing), unless I want to add my tax breaks, which I can do in 5 minutes thorough the web interface. The software itself is not open source, but there's no need for it. Nobody (except business owners) uses paid solutions.
loloquwowndueo 4 hours ago
Please tell us which country so we can all move there.
Ekaros 38 minutes ago
vitorgrs 4 hours ago
chanux 4 hours ago
wtch98 4 hours ago
_factor 3 hours ago
We should have the code documented in a repo and an approved llm to do the taxes where the government will forgive any errors and rectify. The current tax system is akin to the government throwing glue on the ground and allowing companies to charge for pulling you out every year
hn_submit 2 hours ago
I wholeheartedly agree. But the fact is that most politicians are corrupt, even in the Western world. They call it "lobbying.
dachris 8 hours ago
Yes! And it's not only evil giants, even in small countries there's dozens (or even hundreds) of software companies needing to adapt their software after laws pertaining to taxation or finance changes.
Open source and publish as a npm, NuGet etc. package.
alansaber 6 hours ago
Exactly. Versioned law, corresponding updates to tax software. I have written on exactly this, apologies for self promoting https://lexifina.com/blog/formalizing-tax-code-globally
drysine 6 hours ago
>Every country that calls itself democratic and free
Maybe then they will catch up with tyrannical Russia where government provides all the necessary software for filing taxes for free (for over a quarter of century). Some of it (most of it?) is also duplicated as online services.
philipallstar 8 hours ago
You have to support them or you go to jail. Same as the good giants.
lifeisstillgood 8 hours ago
It’s a long slog and frankly I gave up and got a proper job
https://web.archive.org/web/20170906160619/http://oss4gov.or...
alansaber 6 hours ago
It's jarring isn't it because the path to minimising human work, and improving the quality of what exists, is so blatantly clear in this domain
madduci 8 hours ago
Every software paid by citizens' taxes should be made open
loeg 2 hours ago
Perhaps not (all) software for the military or national security.
akudha an hour ago
Not just software. Data, research etc too. Every bid, tender, expense, meeting notes, meeting videos, budgets, research findings etc etc. Except those that genuinely (not "conveniently") need to be secret (military, national security etc).
And truly open and free - without limitations, roadblocks, especially gatekeepers etc. This is almost 2027, this should be the basic minimum in any democracy
alansaber 6 hours ago
This is something i've been working on https://lexifina.com/blog/formalizing-tax-code-globally
Hackbraten 4 hours ago
I don’t think GP was referring to tax codes specifically but any software paid for by taxes.
atcole an hour ago
Me as well, would love to collaborate
lifeisstillgood 8 hours ago
https://web.archive.org/web/20170906160619/http://oss4gov.or...
Im glad you think that way - Im wondering if it’s worth reviving a real campaign to influence our representatives?
Is anyone else out there organising ?
madduci 4 hours ago
At my company, which is fueled by tax money, we have this ethical push to bring tools in the open world, so we started our OSPO program a couple of years ago.
I didn't know about this manifesto, thanks!
TacticalCoder 7 hours ago
And institutions shouldn't be paying money to Microsoft and the like. Doubly so for european institutions.
But illegal kickbacks paid by companies selling turds are a powerful mechanism that guarantees inferior software are used in a great many places.
embedding-shape 3 hours ago
> And institutions shouldn't be paying money to Microsoft and the like. Doubly so for european institutions.
Are you European or why is it so much more important for "European institutions" to not use Microsoft compared to Asian or African institutions? Such a weird specifier without the context why it'd be more important.
Agree with the overall point although I'd take it one step further, without continent/country restrictions: no governments in the world should rely on a for-profit corporation, full stop.
JassanSanjay 6 hours ago
Exactly, but in current world demanding our own rights from governments is far more difficult than building a startup, lol.
wouldbecouldbe 8 hours ago
There are extra cost to open sourcing software the right way
basilgohar 8 hours ago
It's a fact but so is the one that we pay a LOT more for a LOT of other things far less important through our taxes. It's a strawman to point to this as waste and then ignore the huge swath as others.
newsclues 8 hours ago
Glad to pay that.
rendaw 4 hours ago
What costs?
rfgplk 8 hours ago
All software should be made open and intellectual property should be abolished.
smashah 8 hours ago
All weapons development should be open source also.
RobotToaster 7 hours ago
Oddly the US Army has the oldest public open source software repository https://en.wikipedia.org/wiki/BRL-CAD
cannonpalms 8 hours ago
Do you actually believe this?
smashah 3 hours ago
flykespice 4 hours ago
rfgplk 8 hours ago
dlisboa 8 hours ago
From what I heard of people living in other countries, Brazil is much more advanced as far as digital government services go.
ifwinterco 4 hours ago
I've never been but viewed from afar Brazil seems like a weird combination where some things (like digital government services) work really well and other things (like security and crime) work really badly?
soapdog 4 hours ago
Well, part of it is that the federal government is responsible for most of that digital stuff, while crime and security are handled mostly by state and city governments. So if you have a good federal government but live in a disfunctional state, then you experience what you just described more often.
kranke155 3 hours ago
I describe it as the level of social inequality and societal conflict in Brazil comes from it having neighbourhoods that are close to US level of income and others that are like underdeveloped nation level of income - and they are 5 min away from each other.
dlisboa 4 hours ago
That’s a good take. It’s highly developed in some areas and underdeveloped in others. Quality of life varies towards how much you’re exposed to each of those extremes.
jimmydoe 7 hours ago
same as india, they have a lot of contracting biz to usa, that made the availability of digital labor/expertise quite available to gov too.
hagbard_c 8 hours ago
From what I hear from people in Brazil the country is also far more advanced in taxing and levying [1] so that imported goods are far more expensive than 'across the border'. A product with an FOB cost of $100 at the port of export costs $200 to $250 after incurring the Brazilian import taxes and levies (II, IPI, PIS, COFINS and ICMS - most of these are recursive, i.e. 'tax on taxes') and no, this is not a Lula da Silva thing, it has been like that under Bolsonaro and his predecessors for a long time.
[1] https://mybusinessbrazil.com/import-costs-in-brazil-2026-wha...
icantevenhold 7 hours ago
You make it sound like that’s a bad thing though?
Wouldn’t it encourage more domestic production, and thus more and better jobs and long-term sustainability? I think Brasil has more than enough natural resources to produce basically anything.
Fabricio20 7 hours ago
bemtevi 5 hours ago
afarah1 7 hours ago
whou 4 hours ago
docshock 24 minutes ago
owebmaster 7 hours ago
forinti 7 hours ago
At the moment we are paying only ICMS (state tax). I bought earphones from China this week, and these are the values I paid:
Earphones R$76,29
Shipping R$33,68
Tax R$22,56
Total R$132,53
ICMS is 17% but you have to include shipping and it is charged "from the inside", that is, your tax is 17% of the total paid, not a 17% surcharge: 22.56/(76.29+22.56+33.68)=17%.
ewsbr 7 hours ago
lbrito 5 hours ago
I'd rather have high import tax and low income tax. Brazil's top income tax bracket is 27.5%.
kawera 5 hours ago
howunfortunate 3 hours ago
> Lula da Silva thing, it has been like that under Bolsonaro and his predecessors
Those predecessors were...drumroll...literally Lula (and then Lula's party member Dilma while he was in prison)
dlisboa 2 hours ago
snowpid 8 hours ago
Where do you live? It is definitely not clear.
dlisboa 5 hours ago
I live in Brazil. I'm comparing it to people I know living in Europe, Japan, USA. A lot of things still done on paper or in person, specially for health care related things. When they come back for a visit they're always amazed by something new that is just table stakes here.
_3u10 6 hours ago
It’s not.
I had to use AI to help my gf who is Brazilian and a lawyer use the form the embassy gave her to get her CPF.
The AI initially refused saying it was a fake form, eventually it fixed the JavaScript and she got her CPF form done.
To find her birth certificate she had to phone every office in São Paulo to ask if they had it and then we had to fly to São Paulo to get it, she could not even make a power of attorney for another lawyer to do it.
Brazil is a very large joke.
firefax 5 hours ago
Does Brazil have a tax culture like the states where they make it purposefully complex?
NL and others, they seem to give you a report akin to what Turbotax and like spits out and basically invite you to correct them if you think they're wrong but otherwise there's no need to "file" anything.
inib 41 minutes ago
It depends. If you work on your own, it can get complex. If you're properly registered (CLT) it's very simple to declare your taxes. I once did it in ten minutes from my phone in the airport while waiting for a flight. This was in 2019.
I now live in NL. It's just as good.
vitorgrs 4 hours ago
Yes. It's way worse than the US even. Which is exactly this tax reform was made, now it will be more like Canada VAT.
flykespice 4 hours ago
Yes, Brazil tax system is notoriously complex.
For example, when you are buying imported products like from Aliexpress, two taxes are involved: a federal tax applied over the top of the imported price (%20 for <=50U$ shopping, 60% onwards) and a per-state basis ICMS.
soleveloper 5 hours ago
If I find a bug in an open-source tax calculator, is that tax planning or tax fraud?
matheusmoreira 4 days ago
This is awesome! Looking forward to exploring this repository.
econ 4 hours ago
A commercial entity can't really sign of on it. They can only pretend and hope it is correct. If government delivers the code then that is the code, even if it has bugs or typos.
godwinson__4-8 3 hours ago
Good for Brazil and good for Brazil for resisting US government pressure to ram MasterCard and Visa down their throats.
Their payment system is a public service too. Imagine living in a society that didn't support leeching monopolies and a private tax on every transaction in the name of greed. Why are the CEOs of these companies multi millionaires? When was the last time your credit card innovated? Why do we allow what is really a private, pervasive data collection scheme as another version of the corporate service/government client loophole backdoor against the American Bill of Rights?
When one realizes the history of United States meddling in LATAM suddenly the harboring of Bolsonaro in Miami makes a lot more sense.
Local Democrats should follow Brazils lead. Grocery stores in New York should be followed by initiatives like this. An open source city would defeat the enshittification of politics itself.
fvpoabr 3 hours ago
Are you serious? Let’s make a deal: You come to Brazil, and I’ll go to the U.S. You can live here with the wonderful Pix, and I’ll live in the U.S. with the boogeyman Visa and Mastercard.
godwinson__4-8 2 hours ago
Is that how it works? Who traded places with Bolsonaro when he reached Miami?
What part wouldn't I be serious about? What's your logic? I can't criticize my own society on the off chance someone from North Korea might hear and demand I change places? Is that the logic you operate under? Is that how democracy works?
You're going to come to America and wholly refrain from criticizing the society? Nothing could be less American.
Whatever you are upset about in your life in Brazil, I'm sorry for you. But it doesn't make your reply any less unimpressive. Asking "are you serious?" before proposing a quite obviously unserious offer... did you intend to interrogate yourself?
If you have a substantive point to make on the merits why don't you attempt to do so. I would appreciate being disabused of a misapprehension of the facts if I am truthfully under such a burden. Instead all you've really given me is the vague marvel of two people presumably many miles away simultaneously in a sort of dialog but also rather obviously engaging in rather vacuous, "talking past each other" complaining.
I hope you have a good day.
aliljet 3 hours ago
This really should be the case in the United States too...
mococa 7 hours ago
Brazil mentioned https://ibb.co/gFQbpG5T
wbqa_oct6_0e57 7 hours ago
America should do the same. I believe Intuit has government backing of some sort.
alansaber 6 hours ago
There are a few IRS repos but none are official. AFAIK only a handful of govts have official open source repos they haven't killed.
jmclnx 6 hours ago
Interesting, when I dealt with tax software a years ago, Brazil had the craziest rules. IIRC, the president could wake up in the morning and decide the rates change that day. Are their tax rates more stable now ?
lbrito 5 hours ago
You're thinking of presidiantialist governments. Brazil is no different than any other. The president can wake up and sign an XO changing some federal law. But congress will need to approve it after some time, and if of doesn't the change is reversed.
The US income tax bracket changes as much or more than Brazil's.
JassanSanjay 6 hours ago
That's interesting, it could never happen in india sad
astropietro 8 hours ago
i love brazil man
mococa 8 hours ago
We love you
TacticalCoder 6 hours ago
It's good but then... It's 2026 and the latest models, and especially the Gemini ones from my testing, are exceptionally good a filling your taxes and making computation as to what's going to be due. It probably won't be correct to the cent, but it's going to be close enough.
I'm filling mine right now and there are quite a few things: married, one kid, some dividends from shares in a private company, salaries, additional invoices for a side-activity (and VAT and social wellfare taxes etc.), interests, dividends in various currencies that have to be accounted for in a specific way, real-estate income and some expenses, insurances, etc.
Thanks to AI it's much easier than last year. Actually, this year without an accountant is easier than last year with an accountant.
And this time I'm already planning for AI to fill everything next year: so I keep everything, all my notes and "assets" files, and fully plan, in one year, to ask an AI "look at 2025 and do the same for 2026".
And there are crazy things: for example my country's IRS handles PDFs to fill (that you must then print and send in paper form), but they're sloppy PDFs (made by people who've never done typographical work: I did). No two pages have the same sizes for example and its endless hell for a lot of people: for example they don't print properly. Stuff you entered correctly in boxes in the PDF do print on the wrong line etc.
But it's not a problem: the AI can both fill and fix the PDFs so that they then print properly.
vemv 5 hours ago
Having AI write a deterministic program that fills your taxes is fundamentally better. And have some test cases, e.g. your past tax declarations.
InsidiousWombat 8 hours ago
Claude find me a tax loophole
alansaber 6 hours ago
Many such cases https://www.reddit.com/r/ClaudeAI/comments/1y1kbh6/flagging_...
Aboutplants 7 hours ago
You used to have to pay an expensive accountant to find out about these, the floor has been elevated
Izmaki 8 hours ago
I know this is a joke but it hopefully also helps them identify hard-to-identify loop holes now. :P
tekla 8 hours ago
I dont think Brazil has a 401K system like the US
pjmlp 8 hours ago
I hear some banks have excellent advisors, for the right price.
robotswantdata 8 hours ago
“I can't help you find illegal tax loopholes or evade taxes, though I can share common tax-reduction strategies you might discuss with a CPA, or connect you with our sales team to discuss Claude Ultra-Net-Worth ($20,000/month), which replaces my 'harmless' training principles with 'fiduciary duty.'”
Spixel_ 8 hours ago
Hope they accept changes via pull requests!
fidotron 7 hours ago
Should be the case everywhere, as should being able to perform all government interaction via API.
BRB using Claude to find previously unidentified opportunities for tax optimization.
alansaber 6 hours ago
I know this is a joke but in the US at least, tax optimization can still be litigated if it doesn't have any clear commercial value. The numbers are such that, since the scope of IRS audit is so small, most take the risk, but that dynamic in itself will probably change as the IRS increase adoption of AI, etc.
r2ob 4 hours ago
In Brazil, there are so many accounting rules—with constant changes and subjective provisions—that, for all you know, this repository might already be outdated.
pettijohn 5 hours ago
I hope someone is working on an open source Turbo Tax replacement. People are vibe coding Photoshop in a week, can we liberate the people's taxes too!
dzonga 5 hours ago
here on hn people like to shit on java but damn the world runs on java.
even the software irs open sourced was a java stack.
bitlad 7 hours ago
Would be interesting if the taxes dont work because of github action issues.
alansaber 6 hours ago
Github actions is bad, but they at least try. The japanese caselaw archive was casually down for ~10 days recently.
xbar 8 hours ago
Tell them to upgrade their SSL to TLS.
crackalamoo 4 hours ago
Imagine submitting a PR to this. A truly open tax code
filessnap 8 hours ago
What interests me here is the choice of the MIT license, not just the code release. It lets software vendors reuse the calculator directly, so the official rules can be embedded rather than reimplemented.
For a tax reform with new consumption taxes, I'd expect the real value to be a single reference implementation that everyone can test against, so different vendors don't each interpret the rules differently.
Does anyone know whether the repo accepts outside pull requests, or whether it's mainly published for transparency?
alansaber 6 hours ago
It's the most diplomatic license for this use case so perhaps not too surprising
usr1106 8 hours ago
Embedding it correctly into closed source has the advantage it works correctly.
But no external can verify it really was done correctly, only a non-permissive license would allow that.
luizfzs 7 hours ago
I mean, no external entity can today verify that the proprietary software correctly implements the same rules the government uses, so this point is moot.
What it accomplishes is not having each company that accepts payments having to implement their own calculations, and change it every time a rule changes. It frees business to work on other things.
twodave 2 hours ago
A lot of oversimplification is happening in this thread with people claiming the US should do this kind of thing or follow how other countries handle taxes. It is worth noting that the US is more like a collection of 50 small countries with a shared governing body than one homogenous nation. Even if the US made a simple filing tool or open-sourced the federal tax code, which is in itself complex, you essentially still have 30+ states that also require annual personal income tax filings. And some states like Ohio and Pennsylvania rival the federal tax code in terms of complexity. I think there’s still value in having a federal tool, but especially for businesses that operate in multiple states or individuals who work in states with state/local income tax it’s still preferable from both a cost and liability standpoint to have it all coordinated and filed by one provider.
lucasoshiro 39 minutes ago
Do you think that Brazil is that simpler than USA? Brazil has 26 states, 71% of the population of the USA and its area is bigger than the US mainland. It also feels like a collection of several smaller countries, despite being having a more homogeneous government
twodave 34 minutes ago
Yes because they only have federal income tax.
BrokenCogs an hour ago
Just because it's complicated doesn't mean it shouldn't be done. In fact that's even more reason to open source it to remove some of the complexity for tax payers.
twodave 33 minutes ago
Yes thanks for agreeing with me. The point is it’s not 1 decision made by 1 entity but closer to 40. More, really because there are also locals to consider. I’m just pointing out that this news is more comparable to e.g. someplace like Texas, whose tax code is actually simpler (there is no income tax)