This is a simple web-based tool to help you decode and encode bitmasks used by the HAFAS (HaCon Fahrplan-Auskunfts-System) API.
It visually maps a decimal bitmask to the transport modes it represents and vice versa.
🔍 What is HAFAS?
HAFAS is a timetable and journey planning system widely used across European transport networks, including:
- Deutsche Bahn (DB)
- SaarVV
- Luxembourg Mobilitéit
- Many other regional operators
In HAFAS APIs, transport modes (ICE trains, buses, trams, ferries, etc.) are often encoded in a bitmask —
a single number where each bit (1, 2, 4, 8, …) represents a specific type of transport.
✨ Features
- 🔢 Enter a number to decode it into selected transport modes
- ✅ Click transport icons to encode a bitmask value
- 🔄 Switch between different mode sets (DB, SaarVV, Luxembourg, HAFAS client spec)
- ⚠️ Input capped to valid 11-bit range (0–2047)
- 💡 Uses the official hafas-client mode bitmask as one profile