Travel
How To Calculate A Taxi Fare
A taxi fare estimate turns four inputs into a single bill: the base fare, the rate per mile, the number of miles travelled and the tip. Splitting the result into the pre-tip fare, the tip and the effective cost per mile shows exactly where the money goes, and makes it easy to check a meter or compare two quotes.
Last updated
Quick Answer
Fare before tip = baseFare + (perMileRate x miles) | Total = Fare before tip x (1 + tipPercent) | Cost per mile = Total / miles
- baseFare
- The fixed charge owed at the start of the journey
- perMileRate
- The meter rate charged for each mile travelled
- miles
- The distance travelled in miles
- tipPercent
- The gratuity as a percentage of the fare before the tip
Add the base fare to the distance charge to get the fare before the tip, then multiply by one plus the tip rate to get the total. With a 3.5 base fare, 2.25 per mile, six miles and a 15 per cent tip, the fare before the tip is 17.0, the tip is 2.55 and the total is 19.549999999999997. Dividing that total by six miles gives an effective cost of 3.258333333333333 per mile.
What Is A Taxi Fare?
A taxi fare is the amount a passenger pays for a ride, built from a fixed starting charge and a charge that grows with distance. The fixed part is called the base fare, the flag drop or the minimum fare, and it is owed the moment the journey begins. The distance part is the meter rate multiplied by the miles covered. In the worked case the base fare is 3.5 and the rate is 2.25 per mile, so six miles produce a fare of 17.0 before any gratuity. Adding a 15 per cent tip brings the bill to 19.549999999999997, which a card terminal would display as 19.55.
The base fare is the anchor of the whole calculation. At 3.5 it is charged once, not once per mile, and it is payable even if the taxi moves only a few hundred metres. That is why a very short ride can cost almost as much as a longer one, and why the effective cost per mile is so high on short journeys. In this example the base fare makes up about 20.59 per cent of the 17.0 pre-tip fare, with the remaining 79.41 per cent coming from the distance charge. Recognising the fixed component is the first step towards understanding any taxi quote.
The distance charge is a straightforward product: the per-mile rate multiplied by the miles travelled. Six miles at 2.25 per mile gives 13.5, which is the largest single piece of the worked fare. Because it scales with distance, this term dominates on long rides and shrinks in relative importance on short ones. It also explains why the fare rises in a straight line with mileage: add one more mile and the pre-tip fare grows by exactly 2.25, with nothing else changing. If the route is longer than planned, the meter reflects every extra mile.
The tip is calculated on the fare before the tip, never on the final total. A 15 per cent gratuity on 17.0 is 2.55, and adding that to 17.0 gives 19.549999999999997. This convention matters because computing the tip on a different base silently changes the answer. Culturally, the expected gratuity varies widely between countries: in some places it is customary and in others the fare is already considered inclusive. The calculation itself is neutral — it simply applies whichever percentage you choose to the pre-tip amount.
A percentage must be expressed as a decimal before it can be used as a multiplier. Fifteen per cent becomes 0.15, and the total is then the pre-tip fare multiplied by one plus that decimal, or 17.0 x 1.15. This is exactly what happens inside the calculator: because tipPercent is declared as a percentage field with a default of 15, the engine divides it by 100 automatically. Writing another division by 100 into your own expression would apply the discount twice and produce a tip of just 0.0255. The stored result 19.549999999999997 is the raw floating-point value of 17.0 x 1.15, not a typo.
The effective cost per mile takes the full total, tip included, and divides it by the distance. For the worked ride that is 19.549999999999997 divided by six, or 3.258333333333333 per mile. This figure is deliberately larger than the 2.25 meter rate, because it spreads the fixed base fare and the gratuity across every mile. Split it apart and the arithmetic is clear: the tipped mileage rate contributes 2.5875 per mile, while the base fare and its tip contribute roughly 0.6708. Together they rebuild 3.258333333333333 exactly.
That decomposition reveals a useful directional fact: as the ride gets longer, the cost per mile falls. The fixed 3.5 base fare is amortised over more miles, so its share of each mile shrinks towards zero and the effective rate approaches the tipped meter rate of 2.5875. At twelve miles the total is 35.074999999999996 and the cost per mile has dropped to 2.922916666666666. The total bill has risen, but the price of each additional mile is lower. This is the opposite of what many passengers assume, and it is the same reason a long journey offers better value per mile than a short hop.
The tip has no effect at all on the fare before the tip. Change the gratuity from 15 per cent to 20 per cent and the pre-tip figure stays at 17.0, while the tip rises to 3.4000000000000004 and the total to 20.4. Remove the tip entirely and the total is simply 17.0, with a cost per mile of 2.8333333333333335. Keeping the two stages separate is what makes the model transparent: first establish what the meter says, then decide what to add on top. It also makes it easy to compare the cost of different tipping choices without recomputing the distance charge.
This simple model deliberately leaves out several real-world extras. Waiting time, tolls, airport surcharges, luggage fees, night tariffs and congestion charges are common additions that do not appear in the four inputs here. Some operators also round the metered fare up to the nearest whole unit before calculating the tip, which changes the final figure slightly. Treat the result as a reliable core estimate and check the local tariff card before assuming it is the exact amount due. Once the basic arithmetic is understood, any of these extras can be added as another line item without disturbing the structure.
Formula
F = B + R x m
Formula page →Add the fixed base fare to the product of the per-mile rate and the miles travelled. For the worked ride this is 3.5 + 2.25 x 6 = 17.0.
| Symbol | Meaning | Unit | Notes |
|---|---|---|---|
| B | Base fare | currency | The fixed starting charge, 3.5 in the worked case, paid once per journey. |
| R | Rate per mile | currency/mile | The meter charge for each mile, here 2.25. |
| m | Miles travelled | miles | The distance of the ride, six miles in the worked example. |
t = F x p; P = F + t = F x (1 + p)
Formula page →The tip is a percentage of the pre-tip fare, so the total is that fare multiplied by one plus the tip rate expressed as a decimal. With F = 17.0 and p = 0.15, the tip is 2.55 and the total is 19.549999999999997.
| Symbol | Meaning | Unit | Notes |
|---|---|---|---|
| F | Fare before the tip | currency | The metered amount, 17.0 here, which is the base for the gratuity. |
| p | Tip rate as a decimal | decimal | Fifteen per cent is entered as 15 and converted to 0.15 by the engine; do not divide by 100 again. |
| P | Total fare including tip | currency | The pre-tip fare plus the tip, 19.549999999999997 for these inputs. |
C = P / m
Formula page →Divide the all-in total by the miles travelled to spread the base fare and tip across the journey. At 19.549999999999997 over six miles the result is 3.258333333333333.
| Symbol | Meaning | Unit | Notes |
|---|---|---|---|
| P | Total fare including tip | currency | The full amount paid, used as the numerator. |
| m | Miles travelled | miles | The divisor; six in the worked case. |
| C | Cost per mile | currency/mile | The all-in price of one mile, 3.258333333333333 here. |
How To Calculate A Taxi Fare
- 1
Express the tip as a decimal
A 15 per cent gratuity is 0.15 as a multiplier. The calculator handles this conversion for you because tipPercent is a percentage field with a default of 15, so the expression receives 0.15 already. If you are doing the arithmetic by hand, divide 15 by 100 exactly once.
- 2
Work out the distance charge
Multiply the per-mile rate by the distance: 2.25 x 6 = 13.5. This is the part of the meter that grows with the journey, so it is the first figure to recompute if the route changes. Use the actual distance travelled rather than a straight-line estimate.
- 3
Add the base fare for the pre-tip total
Add the fixed charge once: 3.5 + 13.5 = 17.0. This is the fare before the tip, and it is the correct base for any gratuity. Keep it visible as a separate figure so that the tip can be checked independently.
- 4
Apply the tip to get the total
The tip is 17.0 x 0.15 = 2.55, and the total is 17.0 x 1.15 = 19.549999999999997. That long tail is the true stored value of the multiplication and should be copied exactly, not rounded away at this stage. A card reader will present it as 19.55.
- 5
Divide by miles for the effective cost per mile
Take the all-in total and divide by the distance: 19.549999999999997 / 6 = 3.258333333333333. This exceeds the 2.25 meter rate because each mile also carries a share of the base fare and the tip. On a longer ride the same fixed costs are spread further, so this figure falls even though the total rises.
Examples
Example 1: The standard six-mile ride
- baseFare
- 3.5
- perMileRate
- 2.25
- miles
- 6
- tipPercent
- 15
| Step | Calculation | Result |
|---|---|---|
| Distance charge | 2.25 x 6 | 13.5 |
| Fare before tip | 3.5 + 13.5 | 17.0 |
| Tip amount | 17.0 x 0.15 | 2.55 |
| Cost per mile | 19.549999999999997 / 6 | 3.258333333333333 |
| Total fare | 17.0 x (1 + 0.15) | 19.549999999999997 |
Result: A six-mile ride costs 19.549999999999997 in total, made up of 17.0 before the tip plus a 2.55 gratuity, which works out at 3.258333333333333 per mile.
Example 2: Doubling the ride to twelve miles
- baseFare
- 3.5
- perMileRate
- 2.25
- miles
- 12
- tipPercent
- 15
| Step | Calculation | Result |
|---|---|---|
| Distance charge | 2.25 x 12 | 27.0 |
| Fare before tip | 3.5 + 27.0 | 30.5 |
| Tip amount | 30.5 x 0.15 | 4.575 |
| Cost per mile | 35.074999999999996 / 12 | 2.922916666666666 |
| Total fare | 30.5 x (1 + 0.15) | 35.074999999999996 |
Result: At twelve miles the total rises to 35.074999999999996, yet the cost per mile falls to 2.922916666666666 because the 3.5 base fare is shared across twice the distance.
Example 3: The same ride with no gratuity
- baseFare
- 3.5
- perMileRate
- 2.25
- miles
- 6
- tipPercent
- 0
| Step | Calculation | Result |
|---|---|---|
| Distance charge | 2.25 x 6 | 13.5 |
| Fare before tip | 3.5 + 13.5 | 17.0 |
| Tip amount | 17.0 x 0 | 0.0 |
| Cost per mile | 17.0 / 6 | 2.8333333333333335 |
| Total fare | 17.0 + 0.0 | 17.0 |
Result: With no gratuity the total is simply 17.0, and the effective cost per mile drops to 2.8333333333333335 — the 2.25 rate plus a share of the base fare alone.
Calculator
Total fare including tip
$19.55
- Fare before tip
- $17.00
- Tip amount
- $2.55
- Effective cost per mile
- $3.26
Values update as you type. This calculator covers the single scenario its formula assumes — see Common Mistakes for what it leaves out.
Prefer a full-width tool? Open the A Taxi Fare calculator page.
Common Mistakes
Dividing the tip percentage by 100 a second time
The tipPercent field has the unit percent, so the engine already converts 15 to 0.15. Adding another division gives 0.0015 and a tip of just 0.0255 instead of 2.55, which makes the total almost correct-looking but plainly wrong.
Calculating the tip on the wrong amount
The gratuity applies to the 17.0 fare before the tip, not to a rounded or already-tipped figure. Applying 15 per cent to a different base changes the tip and therefore the total, so always establish the pre-tip fare first.
Rounding the raw total too early
The stored value of 17.0 x 1.15 is 19.549999999999997, a genuine floating-point result. Replacing it with 19.55 before dividing by miles slightly changes the derived cost per mile; carry the exact value through intermediate steps and round only for display.
Confusing cost per mile with the meter rate
The 3.258333333333333 figure includes the base fare and the tip, whereas 2.25 is only the distance charge on the meter. Quoting the meter rate as the all-in price per mile understates what the journey actually costs.
Assuming a longer ride always costs more per mile
The opposite is true here: at twelve miles the cost per mile falls to 2.922916666666666. The fixed base fare is spread over more miles, so the effective rate declines towards the tipped meter rate of 2.5875 even as the total rises.
Charging the base fare for every mile
The 3.5 base fare is paid once at the start of the journey, not once per mile. Multiplying it by six would add 21.0 to the bill and more than double the pre-tip fare.
Ignoring surcharges and waiting time
Tolls, airport fees, night tariffs and waiting time are not in these four inputs. For an airport run or a journey in heavy traffic, add them as extra line items rather than expecting the core estimate to match the receipt.
FAQ
What goes into a taxi fare estimate?
Four inputs: a fixed base fare, a charge per mile, the number of miles travelled and a tip expressed as a percentage. The base fare and distance charge give the fare before the tip; the gratuity is then applied to that amount to produce the total.
How is the tip calculated?
Multiply the fare before the tip by the tip rate as a decimal. At 15 per cent on a 17.0 fare the tip is 2.55, and the all-in total is 17.0 x 1.15. Fifteen per cent is entered as 15 in the percentage field and the engine converts it to 0.15 automatically.
Why does the total show 19.549999999999997 instead of 19.55?
That is the exact floating-point result of multiplying 17.0 by 1.15. It is the real stored value, so it is copied verbatim rather than rounded. A payment terminal would display the same amount as 19.55.
What is the effective cost per mile and why is it above the meter rate?
It is the total fare divided by the distance, 3.258333333333333 here rather than the 2.25 meter rate. Each mile must also carry a share of the fixed base fare and of the tip, which together add roughly 0.6708 per mile at this distance.
Does a longer journey cost more per mile?
No — in this model it costs less per mile. The base fare is paid once, so spreading it over twelve miles instead of six lowers its share of each mile and the effective rate drops from 3.258333333333333 to 2.922916666666666, even though the total bill increases.
What does this estimate leave out?
Waiting time, tolls, airport and night surcharges, luggage fees and any rule that rounds the metered fare before tipping. Check the local tariff card and add such items separately if they apply to your journey.
References
- [1], Taxi — https://en.wikipedia.org/wiki/Taxi
- [2], Fare — https://en.wikipedia.org/wiki/Fare
- [3], Gratuity — https://en.wikipedia.org/wiki/Gratuity
