fr-bareme-km

French tax mileage allowance scale (bareme kilometrique), tax returns 2022 to 2026, with the 20 % increase for electric vehicles.
https://macalculatriceenligne.com/finance/divers/calcul-frais-kilometriques/

To install, run:

haxelib install fr-bareme-km 0.1.0 

See using Haxelib in Haxelib documentation for more information.

README.md

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).

Contributors
macalculatriceenligne
Version
0.1.0
Published
5 weeks ago
License
MIT

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub

⌂