| Crates.io | uk-tax |
| lib.rs | uk-tax |
| version | 0.1.2 |
| created_at | 2025-07-06 22:47:45.310234+00 |
| updated_at | 2025-07-07 22:30:19.769131+00 |
| description | A Rust library that calculates UK PAYE Income Tax and Class 1 National Insurance contributions with historical tax year support. |
| homepage | https://github.com/lst1000/uk-tax |
| repository | https://github.com/lst1000/uk-tax |
| max_upload_size | |
| id | 1740488 |
| size | 15,441 |
A Rust library that calculates UK PAYE Income Tax and Class 1 National Insurance contributions with historical tax year support.
Supports historical tax years (2011/12 to 2025/26) and allows custom personal allowances to be specified, if needed.
income_tax)national_insurance)Add this to your Cargo.toml:
[dependencies]
uk-tax = "0.1.2"
use uk_tax::{income_tax, national_insurance, TAX_YEAR_2025};
fn main() {
let gross_income = 60_000.0;
// Calculate income tax
let tax = income_tax(gross_income, &TAX_YEAR_2025, None).unwrap();
println!("Income Tax: £{:.2}", tax);
// Calculate National Insurance
let ni = national_insurance(gross_income, &TAX_YEAR_2025, None);
println!("NI: £{:.2}", ni);
}
Planned or potential improvements:
MIT Licence.
See LICENSE for details.
Pull requests and issues are welcome!
Written by Laurence Stock-Tully