Lurker News
I wanted to share a simple web app I created recently, which lets you estimate income taxes owed in the US: https://taxsim.app

All the calculations occur directly in the browser, and are powered by a Fortran program that has been converted to WASM using emscripten. This calculator was originally developed in the 1970s [1] by the non-profit National Bureau of Economic Research. NBER has been maintaining this F77 codebase for the last 50 years, and uses it primarily for academic research on tax policy. The Fortran source code itself is over 1MB of text, because it codifies both federal and all 50 states' tax laws for each of the last 62 years.
I first learned about NBER TAXSIM [2] a few months ago via an interesting paper they published "Automatic Tax Filing: Simulating a Pre-Populated Form 1040" [3]. The Fortran code itself is not open-source, but is available on request for research purposes. I reached out to NBER and proposed compiling it to WASM, so it could be run directly in a browser. With relatively little effort I was able to create a js/wasm version [4], thanks in huge part to previous open-source work [5].
This WASM build now powers https://taxsim.app, which is my attempt to create an interactive UI to allow for easier exploration of the US tax code. Specific tax scenarios can also be shared easily, by simply copying the browser URL. The code for this webapp is also open-source [6].
This was my first time experimenting with WASM, and I am already a huge fan. Not only was I able to take a 60 year old codebase and get it working on every modern browser and device, this work is also now benefiting the academic community. For example, the js/wasm can be run directly in V8, which means it can also now be run locally within R using libv8 [7]. Previously most researchers were uploading their tax scenarios to NBER's servers via ftp/ssh/http.
[1] https://taxsim.nber.org/feenberg-coutts.pdf
[2] https://taxsim.nber.org/
[3] https://www.nber.org/papers/w30008
[4] https://github.com/tmm1/taxsim.js
[5] https://chrz.de/2020/04/21/fortran-in-the-browser/
[6] https://github.com/tmm1/taxsim.app
[7] https://github.com/shanejorr/usincometaxes/pull/11

Comments (155) 41 threads

MaxGhenis1 reply#
Fantastic job making taxsim more accessible! We've built an open-source version of taxsim called OpenFisca US [1] which we expose in our (also open-source) web app, PolicyEngine US [2]. We haven't yet implemented all of taxsim—we only have the most recent couple of years, and not all states—but we have some advantages like implementing means-tested benefits and being able to simulate custom tax and benefit reforms, both on individuals and the population (e.g. the budgetary and poverty impacts).

I'd love to get in touch. Will email you from max@policyengine.org.
[1] https://github.com/policyengine/openfisca-us
[2] https://policyengine.org/us

nomilk1 reply#
This looks great. Some quick examples of how to use it in the readme would give users a quick and easy way of exploring what it can do.
MaxGhenis#
Thanks for the suggestion, I added a link to our documentation (https://openfisca.us) to the readme.
keehun7 replies#
Are all the dollar amounts in the simulated tax output at the top of the page inflation adjusted?

For example, I inputted married, with no dependents with $500,000 salary and in 1977, the federal amount was $299,864 and in 2020 was $133,947. I assume these amounts can be compared without further adjusting for inflation?
Tangentially, did federal taxes really come down that much?

sgjohnson3 replies#
But nobody ever paid it as there were millions of loopholes.
thnujmikkkk#
source?
standardUser10 replies#
You have to be actually wealthy for most "loopholes" come into play. Just like today, non-wealthy high earners take the biggest hit in taxes. And there are way more of those than actually wealthy people. Back then, the hit was even bigger, but the group being hit the hardest was smaller.

Politically, this setup seems to help keep those high-earners voting for lower taxes, which makes sense to them since they're the ones paying the highest overall rate.

Continue this thread — 10 replies

UncleMeat1 reply#
Up thread somebody asked what these were. A response had credit card interest deductions (rich people aren't running a credit card debt today, and certainly not in 1970) and easier tax fraud.

This is such a compelling narrative for the "taxes should be lower" crowd that I'm skeptical. Granted, this is my personal bias. But I would love to see the actual clear examples of how people are deducting like 50% of their income or whatever they'd need to bring their 70% marginal rate down to 35%.

Continue this thread — 1 reply

jandrewrogers3 replies#
In the 1970s there were massive tax deductions that don't exist today, so the actual tax incidence was much lower than what is implied by the marginal tax rates.

There was a major overhaul of the tax code in the 1980s that simultaneously eliminated many of the tax deductions and offset that loss of deductions with lower the marginal tax rates. The change was approximately revenue neutral but made the tax code simpler.

ajmurmann1 reply#
seems like this would render the website pretty useless for anything before that period, right?
femiagbabiaka12 replies#
It’s not useless, it’s just data which needs context. Like the claim which GP makes that the Reagan tax reform was “revenue neutral” which is dubious at best.

Continue this thread — 12 replies

hammock2 replies#
What were the biggest deductions that don’t exist today?
khuey10 replies#
On the individual side, all personal interest (e.g. credit card interest) was deductible and you could claim dependents (and their corresponding deductions) without any evidence (like a child's social security number).

Continue this thread — 10 replies

ameister142 replies#
So there were a few.

One of the biggest was that there was an investment tax credit of 7% in the 60's and 10% in the 70's, which I believe was uncapped. I think those were also able to be rolled over to cover multiple years. That means that if you invested enough, you could pay essentially no taxes. This was repealed in 1986.
[edit] Another that I should probably mention is the treatment of asset depreciation; in the 1960's and 70's the government was incredibly generous with regards to asset depreciation. For example, they allowed more rapid depreciation so you can have assets fully depreciated while still within their useful life and potentially if you sold those would pay capital gains tax on them, meaning you reaped significant tax savings over the asset's lifetime.

Continue this thread — 2 replies

m0llusk#
That was a complex situation. At that time the IRS did a lot of investigation and you had to be very rich and clever to really make tax cuts work. My father worked as an airline pilot in the 1970s and paid a 75% rate which made him irrational about taxes. What was most often done was not relying heavily on tax exemptions but rather on compensation packages where employees could have a company car and a company condo and make use of the company country club membership and so on.
Melatonic1 reply#
Do you mean are the brackets themselves tax adjusted or the salaries? Because lets say there is a 300-500k bracket right now - that bracket (if it even existed in the 70s) would have been much, much higher.
Nition#
Agreed in principle, but I think you mean much lower?
gopi#
Yes, the marginal income taxes were high but the capital gain taxes were low, so the rich didn't pay much. For example when the top income tax was 91% in the 1950s the capital gain tax was just 25%. See the historical top income and capital gain tax rates here https://ctj.org/pdf/regcg.pdf
ren_engineer2 replies#
as others stated there were a lot more loopholes

the other thing people don't mention is that companies got around higher tax rates by giving benefits like company cars and other things to entice employees when giving a higher salary would be stupid due to high tax rates. This is how things like health insurance ended up getting tied to employment, always unintended consequences

sharkmerry#
It actually wasnt taxes with health insurance. They froze wages during ww2 but exempted health insurance from the cap.

Same result. different cause (in this case)

calvinmorrison#
I was going to bring this up! good call out
lend000#
The top tax bracket in 1913, the first year of the federal income tax as it exists today, was equivalent to ~14 million dollars at today's value.

Our wealth inequality problems could largely be solved by fixing the tax brackets (especially w.r.t. capital gains). We don't need all sorts of new taxes, certainly not a wealth tax, before fixing the obvious problem.
That being said, $500,000 should have been taxed more heavily in 1977 relative to today in a perfect world, because that amount of money was worth a lot more back then. I don't think the numbers are inflation adjusted or it would make sense to do so without a big warning.

pjc50#
I would not expect this to cope with inflation but to operate purely on nominal values; after all, that's what you'd put in the tax returns for those years.
tick_tock_tick3 replies#
This seems beyond misleading it doesn't even have a method to enter most of the now illegal methods to lower your tax bill.

Tax straddles were only banned in 1977 before that you should have easily been able to more then halve your tax bill with futures.

yieldcrv#
Interesting, this is probably why I never heard of straddles in a futures context

They are wildly popular in the options (including futures options) market, but what is described here would be called a calender spread or an unbalanced strangle of some sort. No tax benefits from closing long dated contracts early aside from losses offsetting the gains

thelamest#
Doesn’t this fit into “other adjustments”? Net operating loss is listed among the examples there.
mywittyname1 reply#
I've never heard of tax straddles, but they sound an awful lot like what we now call "tax loss harvesting."

> For example, an investor with a capital gain manipulates investments to create an artificial loss from an unrelated transaction to offset their gain in a current year, and postpone the gain till the following tax year.

brewdad#
At least tax loss harvesting is recognizing a real loss. Wash rules mean you can't just dump your money back into the same investment.
googlryas#
Very cool, especially hearing about the implementation.

Feature request: Put the effective overall tax rate calculation somewhere on the page - so often people are confused that they are paying the same percentage tax as their highest marginal tax rate, this tool could help elucidate that mistake.

Load more comments