All projects

Case study · 2026

Da RAL a netto

A take-home pay calculator for employees in Italy. You enter the gross salary and it shows the yearly and monthly net, with every deduction explained and linked to the law it comes from.

Type
Static web app
Role
On my own: sources, calculation, interface, tests
Stack
JavaScript, HTML, CSS, no libraries
Tests
657 automated checks
The calculator with a gross salary of 30,000 euro in Milan, tax year 2026
Gross salary 30,000 €, living in Milan, 2026: 1,801.96 € net a month, the year's net spread over 13 pay packets.

What it is

It started as an exercise for a job interview. The calculation itself is ten steps. The long part was working out which steps, in what order and with which values, by reading the laws, the INPS circulars and the municipal rates published by the Ministry of Finance.

Many sources online still carry old values. For example, the second income tax bracket has been 33% since 2026, but plenty of pages still say 35%.

What you can do

  • Tax years 2025 and 2026
  • All 21 regional/provincial tax jurisdictions and 7,894 municipalities
  • Dependants, fringe benefits and fixed-term contracts
  • Net pay month by month, with the 13th month and the December adjustment
  • Reverse calculation: from the net you want to the gross you need

How it works

Waterfall chart from gross salary to net pay

From gross to net

The chart starts from the gross salary, takes away contributions, income tax and the regional and municipal surcharges one at a time, and ends at the yearly net.

A table row opened to show its explanation

Every item opens up

In the table under the chart, every row expands and explains in words what that item is. Here, for example, what the gross salary includes and what it doesn't.

Amounts with links to the law and the municipal resolution

Every amount has its source

Next to each deduction there's the reference: the article of law or the municipal resolution, linked to the official page.

Step chart of how much of each extra euro you keep

What a raise is worth

A separate page shows how much of each extra euro you keep. Between 35,000 and 44,000 € of gross salary it's about 39 cents, less than at 70,000 €, because in that range the employee tax deduction and the tax wedge deduction both shrink with every euro earned.

Technical choices

Official sources only

What I did

Laws from Normattiva, contribution thresholds from the INPS circular, local rates from the Ministry of Finance portal. Every value used is listed on a page with its source.

What I ruled out

Starting from blogs and other calculators: they copy each other, mistakes included.

If a municipality doesn't set a new rate, the old one stays

What I did

By law the previous year's rates stay valid. In 2026 that applies to 3,827 municipalities, and the calculator always says which year the rate it uses comes from.

What I ruled out

Treating a missing resolution as a zero surcharge: the net would be wrong in all of those municipalities.

The tests' expected results come from the law

What I did

In the 657 checks the correct result is worked out from the legal formulas, especially near the thresholds where mistakes are easy. I also downloaded 120 random municipalities again and compared them with the data: all identical.

What I ruled out

Running the code and copying its output into the tests: a bug would become the expected result.

What it doesn't do

  • It doesn't include deductible expenses and tax credits for expenses.
  • It doesn't include company welfare or performance bonuses, which have their own rules.
  • It doesn't cover the flat-rate scheme or other special tax regimes.
  • Above 200,000 € of income the result isn't reliable.
  • The cost to the employer is an estimate, not a legal calculation.

Next step · tax year 2027

A new tax year means copying the two files of the previous year, one for national parameters and one for regional and municipal rates, updating values and sources, registering the year, and regenerating the municipal data with two commands.