Rideshare fare estimate
With a 2.5 base, 1.25 per mile and 0.3 per minute, an 8.4-mile ride lasting 22 minutes comes to 19.6 before surge: 10.5 for distance and 6.6 for time. Budget a trip or check an expense line. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Base fare
- 2.5
- Per mile rate
- 1.25
- Per minute rate
- 0.3
- Distance
- 8.4
- Duration
- 22
- Distance charge
- 10.5
- Time charge
- 6.6
- Estimated fare
- 19.6
Planning a rideshare or comparing platform quotes often starts with one transparent question: what does the trip cost before surge? Any negative rate is rejected as invalid input so inverted or corrupted pricing never produces a nonsense credit.
Three parts make up the fare before surge
Most rideshare fares before surge add three pieces: a fixed base fare, a distance charge and a time charge. The distance charge is the per-mile rate times the length of the trip; the time charge is the per-minute rate times the minutes it takes. With a base of 2.5, 1.25 per mile and 0.3 per minute, an 8.4-mile ride lasting 22 minutes gives a distance charge of 10.5, a time charge of 6.6 and an estimated fare of 19.6. Seeing each part separately shows whether a long route or a slow one drives the price.
When it helps and what to watch
Travellers use it to budget a ride before booking, expense tools use it to turn trip miles and minutes into a clear fare line, and planners compare two cities' rate cards on the same route. Keep units consistent: if the rate is per kilometre, enter the distance in kilometres, and give the duration in minutes. Use published rate cards or your contract rates rather than guesses. The result is in whatever currency your rates use, with no conversion, and negative rates, distances or durations are refused.
How pre-surge rideshare fare is computed from base, distance, and time
A typical rideshare fare before surge is the sum of three parts: a fixed base fare, a distance charge equal to the per-mile rate times trip length, and a time charge equal to the per-minute rate times trip minutes. For example, a two-dollar-fifty base, one-dollar-twenty-five per mile, and thirty cents per minute on an eight-point-four mile trip lasting twenty-two minutes yields a distance charge of ten dollars fifty, a time charge of six dollars sixty, and an estimated fare of nineteen dollars sixty.
Keep units coherent—if the rate is per kilometre, distance must be in kilometres. Negative rates are hard errors under the product contract; negative distance or duration is likewise rejected.
What you can do with it
Trip budgeting before booking a rideshare
Travellers enter published base, per-mile, and per-minute rates with planned distance and duration to estimate pre-surge fare before choosing a platform or mode.
Expense and reimbursement tools
Expense apps convert trip miles and minutes plus a known rate card into a transparent fare line with distance and time charges for audit logs.
Rate-card comparison across cities
Product teams and fleet planners compare two rate cards on the same route length and time to see which city pricing yields a lower estimated fare.
FAQ
Does this include surge pricing or minimum fares?
No. This calculator only computes base plus distance charge plus time charge.
Is the rideshare fare estimate calculator free?
The browser tool runs free on your device.
Can I use kilometres instead of miles?
The engine is unit-agnostic; keep distance and rate units coherent yourself.
Where do I find the rates to enter?
Use the rate card published for the city or the rates in your own contract, rather than guessed figures. You need three numbers: the base fare, the price per mile or kilometre and the price per minute.
Can I compare rate cards from two cities?
Yes. Enter the same distance and duration with each city's base, distance and time rates, and compare the two estimated fares. The breakdown shows whether the gap comes from the distance charge or the time charge.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/travel/rideshare-fare-estimate \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"base_fare":2.5,"per_mile_rate":1.25,"per_minute_rate":0.3,"distance":8.4,"duration":22}'const res = await fetch("https://api.kit.forhosting.com/travel/rideshare-fare-estimate", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"base_fare": 2.5,
"per_mile_rate": 1.25,
"per_minute_rate": 0.3,
"distance": 8.4,
"duration": 22
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/travel/rideshare-fare-estimate",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"base_fare": 2.5,
"per_mile_rate": 1.25,
"per_minute_rate": 0.3,
"distance": 8.4,
"duration": 22
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/travel/rideshare-fare-estimate", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"base_fare":2.5,"per_mile_rate":1.25,"per_minute_rate":0.3,"distance":8.4,"duration":22}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"base_fare":2.5,"per_mile_rate":1.25,"per_minute_rate":0.3,"distance":8.4,"duration":22}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/travel/rideshare-fare-estimate", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"base_fare": 2.5,
"per_mile_rate": 1.25,
"per_minute_rate": 0.3,
"distance": 8.4,
"duration": 22
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "travel.rideshare_fare_estimate",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
This rideshare fare estimate calculator multiplies trip distance by your per-mile rate and trip duration by your per-minute rate, then adds the base fare to produce estimated_fare with a clear distance_charge and time_charge breakdown. Enter base_fare, per_mile_rate, per_minute_rate, distance, and duration as JSON numbers or numeric strings to get stable, deterministic results for travel apps, expense tools, and classroom demos.
How pre-surge rideshare fare is computed from base, distance, and time
Send required fields base_fare, per_mile_rate, per_minute_rate, distance, and duration as JSON numbers or numeric strings. Aliases base, flat_fare, and booking_fee map to base_fare; mile_rate, per_km_rate, distance_rate, and rate_per_mile map to per_mile_rate; minute_rate, time_rate, and rate_per_minute map to per_minute_rate; miles, km, trip_distance, and d map to distance; minutes, time, trip_minutes, and t map to duration. Magnitude caps keep results finite on the Worker isolate. Identical inputs always produce identical JSON: pure arithmetic, no network, no random seed, and no wall clock.
Reading the response fields and choosing realistic inputs
The formula field is safe to show next to the numbers so users see that estimated fare equals base plus distance times per-mile rate plus duration times per-minute rate. Prefer published city rate cards or your own contract rates over guessed brochure figures. Currency is whatever unit you use for the rates; the engine is unit-agnostic and does not convert dollars to euros. On success the response echoes base_fare, per_mile_rate, per_minute_rate, distance, and duration after stable rounding, plus distance_charge, time_charge, estimated_fare, a human-readable formula string, and method equal to base_plus_distance_plus_time. Use distance_charge and time_charge when you need an audit-friendly breakdown for riders or expense reports; use estimated_fare when budgeting a trip or comparing rate cards across cities. This endpoint does not model surge multipliers, minimum fares, tolls, waiting time, or cancellation fees; it is a transparent arithmetic check, not a live pricing API. Missing required fields, non-finite values, and any negative rate all fail with invalid_input and are not charged after the engine rejects the request.
API usage, pricing, travel workflows, and practical limits
Call the free in-browser rideshare fare estimate calculator for trip planning, classroom demos, and quick rate-card comparisons without installing a spreadsheet. Send a JSON body with base_fare, per_mile_rate, per_minute_rate, distance, and duration (or the documented aliases). Use the prepaid API when a travel portal, expense app, fleet tool, or booking flow needs a stable contract under KIT balance at $0.002 per successful item; validation failures never consume balance. Pair this endpoint with a route distance or ETA calculator when you only know pickup and dropoff and must first obtain miles and minutes—then call here with matching rate units. For multi-leg itineraries, sum estimated_fare client-side or call once per leg so each segment stays auditable. Authors shipping SDKs can map distance_charge, time_charge, and estimated_fare into tables that show the same shape riders see on a simple fare receipt before surge.
Technical questions
How do I estimate a rideshare fare with this calculator?
Send JSON with base_fare, per_mile_rate, per_minute_rate, distance, and duration. The response includes distance_charge, time_charge, and estimated_fare before surge.
What happens if a rate is negative?
The request fails with invalid_input. Any negative base_fare, per_mile_rate, or per_minute_rate is rejected so the engine never returns a nonsense credit.