Building an accurate (full) tax calculator

Written by Cory Westropp

Whenever I am evaluating a potential raise or job offer I like to know exactly how it will affect my tax burden. To that end I usually search for some online tax calculator. The problem with this approach is that none of the tax calculators I have been able to find will combine all the different taxes that you have to pay to into one calculation (namely FICA and State Disability, which I always forget). I always have to get three different numbers form three different places and put them together. Not only is this annoying and error prone, but it makes it hard to compare different scenarios. So I decided that I am going to build my own.

The Taxes

Some taxes are easier to calculate than others. Medicare and Social Security are easy, but state and federal income are not. The calculator will initially support the following taxes:

  • Federal Income
  • State Income (CA)
  • Social Security
  • Medicare
  • State Disability Insurance (CA)

I am building the calculator so that I can easily add more states and update the tax tables for the next year. I also will set it up so that you can see the tax difference between now and next year, if the tax tables for next year have been released. I think in the future I will look for a way to do the update automatically through an API maybe.

The App

I’ve decided that I want to split the actual calculation code and the website into different parts to that I can reuse the calculator in other projects if I want to.

Calculation Code

This will be ES6 (because awesome) and calculate the different taxes given a json tax table and an income. Easy peasy.

The Website

I was thinking about doing a simple ReactJs app that stored its data in localStorage so you can leave the page and not have to type in your data again. I also found a blog post a little while back about freezerJs and wanted to see what that was about. Freezer was incredibly easy to set up and the todomvc example was already set to save data into localStorage, so yay.

I might build an excel export feature in the future, but I’m not sure of the utility of such a function yet.

You can view the source here. There is still a lot of work to do, but this meets my needs for the immediate future.