How we calculate
No black boxes here. Every number on tripcost.co.za comes from a real source and a documented formula. Here's exactly how it works.
1. Distance
For Phase 1, distances are calculated using the haversine formula — the straight-line distance between two GPS coordinates — multiplied by a road factor of 1.3 to account for the fact that roads aren't straight. This is a reasonable approximation for South Africa's major inter-city routes; it typically lands within 5–10% of the actual road distance.
We'll be honest: haversine is a fallback. The next version of tripcost will use OpenRouteService (an open-source routing engine with good SA coverage) for real road distances and drive times. When that goes live, we'll update this page and the "last updated" stamp on each route.
Drive time is estimated as distance divided by an average speed of 100 km/h — a conservative default that reflects typical highway speeds between SA cities. Real drive times vary with traffic, mountain passes, and lekker stops.
2. Toll fees
Toll data lives in a manually curated tolls.json
file. Every plaza has been cross-checked against at least two official sources. We track
four vehicle classes:
| Class | Description | Examples |
|---|---|---|
| 1 | Light motor vehicle | Sedan, SUV, bakkie, motorcycle |
| 2 | Light motor vehicle with trailer | Car + caravan, bakkie + trailer |
| 3 | Heavy vehicle, 2–3 axles | Light truck, minibus |
| 4 | Heavy vehicle, 4+ axles | Articulated truck, interlink |
For a given route, we determine which plazas fall on the path between origin and destination and sum their tariffs for the selected vehicle class. Plazas are matched by GPS proximity to the route — a plaza within 500m of the estimated road path is included.
Important: SANRAL increases toll tariffs annually, typically in March.
We update tolls.json after each increase and note
the verification date on every plaza. Check the "Toll prices last verified" stamp
before using figures for financial planning.
Toll data sources
3. Fuel cost
Fuel cost is calculated as:
Default consumption figures by vehicle type:
| Vehicle | L/100km | Toll class |
|---|---|---|
| Sedan | 7 | 1 |
| SUV | 9 | 1 |
| Bakkie | 10 | 1 |
| Motorcycle | 5 | 1 |
| Truck | 35 | 4 |
Pump prices are sourced from the DMRE monthly petrol-price schedule and verified against fuelsa.co.za. Separate inland and coastal prices are used — the planner auto-selects based on your origin city.
Fuel prices are updated on or shortly after the 1st of each month, following the official DMRE announcement. The "Last fuel update" stamp in the footer shows when we last refreshed.
Fuel data sources
4. Round trip
Simple: when "round trip" is toggled on, every cost component (tolls + fuel) is multiplied by 2. We assume the return journey follows the same route. If your return route differs significantly — for example, if you come back via the N2 instead of the N3 — the estimate won't capture that, and you'd want to run two separate calculations.
5. Accuracy and limitations
- Distance is currently a haversine-based approximation (×1.3 road factor). Actual road distances may differ, especially on routes with significant detours or mountain passes.
- Tolls are verified manually and may be out of date between our update cycles. SANRAL increases fares annually in March; check the verification stamp.
- Fuel pump prices vary up to R0.30/L between stations and provinces. The figure shown is the official regulated price for your region.
- Vehicle consumption varies with load, driving style, altitude, and aircon use. Our defaults are conservative highway estimates.
- Traffic is not factored into drive time. Add 20–30% on any drive leaving Johannesburg between 15:00 and 18:00 on a Friday before a public holiday.