- Published on
Building a Bangladesh tax calculator after a costly 2020 tax bill

- Authors

- Name
- Nadim Tuhin
- @nadimtuhin
On this page
In 2020 I got a tax bill that was a lot bigger than I expected. The reason was simple: I didn't know Bangladesh's tax rebate schemes existed.
That bill sent me off to learn how the system really works. Then I built the Bangladesh Tax Calculator, the tool I wish I'd had that year.
Why the math trips people up
If you're an employee in Bangladesh, you've probably felt this. There are tax slabs, rebate schemes and investment quotas. The trap is that they all interact, so working out what you owe is harder than it should be.
That confusion often means people overpay, or miss savings that the law already gives them through rebates.
The engine starts from the baseline individual slab progression:
| Annual Income Bracket (BDT) | Tax Rate | Max Tax for Slab |
|---|---|---|
| First 350,000 | 0% | 0 |
| Next 100,000 | 5% | 5,000 |
| Next 300,000 | 10% | 30,000 |
| Next 400,000 | 15% | 60,000 |
| Next 500,000 | 20% | 100,000 |
| Balance | 25% | Variable |
Then the rebate. This function works out the credit you can take against your gross tax:
export function calculateRebate(taxableIncome: number, investment: number): number {
// Allowable investment capped at 20% of taxable income or 1,000,000 BDT
const eligibleInvestment = Math.min(investment, taxableIncome * 0.2, 1000000)
return Math.round(eligibleInvestment * 0.15) // 15% investment tax credit
}
Three caps, one Math.min. Your eligible investment is the smallest of what you invested, 20% of taxable income, or 1,000,000 BDT. You get 15% of that back as a credit against your tax.
What it does today
The calculator has grown over the years to keep up with Bangladesh's changing rules:
- Year-wise updates: it keeps the historical rules from 2020 onwards, so you can calculate tax for different fiscal years.
- Dynamic tax slabs: pick a fiscal year and the slabs and rates switch to match.
- Investment quota calculations: it factors your investment quota in, so you can see how to save on tax.
- Simple interface: plain input forms, no accounting knowledge needed.
Keeping up with a moving target
Bangladesh's tax rules change every year. The changes usually land in three places:
- Tax slab rates and thresholds
- Investment quota limits
- Rebate percentages and conditions
I update the calculator to reflect these changes across multiple fiscal years.
Note: The calculator is updated periodically. Check the GitHub repository for the latest supported fiscal year.
What I might add next
A few ideas I'm considering:
- Special tax calculation support for elderly citizens
- Dedicated features for women taxpayers
- Tax computation adjustments for differently-abled individuals
- Deeper tax planning tools
What it's become
It started as a personal tool. Now it helps employees in Bangladesh understand what they owe, plan investments for a better tax outcome, and make more informed money decisions.
Takeaways
- If you're a salaried taxpayer in Bangladesh, check the rebate rules for your fiscal year before you file. That's the lesson my 2020 bill taught me.
- Tax rules that change every year are a good fit for code that keeps each year's rules side by side.
- A gap in your own knowledge is a decent place to start a project.
The project is open source and contributions are welcome. As the rules keep changing, the calculator will keep up.
Resources
Related posts
- opencode-9router: model discovery for OpenCode from a 9Router gateway
An OpenCode plugin that asks a 9Router gateway for its models at startup, fills in limits and capabilities, and caches the list. v1.0.0, 26 tests after a six-fix PR.
- express-simple-proxy: an Express proxy with hooks and typed errors
express-simple-proxy forwards Express routes to an upstream API with error codes, a beforeRequest hook and an onResponse callback. 183 tests, two runtime dependencies, and rough edges I found.
- devutils: 33 browser-only dev tools and what the README overstated
devutils runs JSON, JWT, SQL and Base64 tools in the browser with no network calls. I checked the README against the code: the privacy claim holds, the 35+ tool count did not.