fr-bareme-km
Dependency-free Haxe library published by MaCalculatriceEnLigne.
French tax mileage allowance scale ("bareme kilometrique"), used to deduct professional travel costs ("frais reels") from French income tax.
- Tax returns 2022 to 2026 (income years 2021 to 2025)
- Cars, motorcycles (more than 50 cm3) and mopeds
- 135 rates, three distance bands per horsepower class
- 20 % increase for 100 % electric vehicles
import baremekm.BaremeKm;
// 2026 tax return (2025 kilometres), 5 CV car, 4 000 km
var m = BaremeKm.amount(2026, Car, 5, 4000); // 2544
// Same car, 100 % electric
m = BaremeKm.amountElectric(2026, Car, 5, 4000); // 3052.8
Inputs outside the scale (year, vehicle type, horsepower, distance) throw an
OutOfScaleException whose cause is OutOfScale.Year, OutOfScale.Vehicle,
OutOfScale.Horsepower or OutOfScale.Distance.
The same computation is available online, in French, with the detail of each band: French mileage allowance calculator.
The rates are a port of the Go package baremekm, itself a port of the
SWI-Prolog pack fr_bareme_km 1.0.0; the tests replay each of the 135 facts
of the pack and its test cases. Official sources: BOFIP BOI-BAREME-000001
(2022, 2023), DGFiP brochures pratiques IR (2024 to 2026),
service-public.gouv.fr A14686 (2026). Dataset: doi:10.17632/5s59m9wycw.1
(CC BY 4.0).
This library is an aid to calculation, not tax advice. The official texts prevail.
Licence
Code: MIT, see LICENSE. The scale values are official French tax data (DGFiP, Licence Ouverte / Open Licence Etalab 2.0).