Flight price per mile calculator
Spread a fare over the distance actually flown: a 2,450-mile route also counts as 3,942.8928 km, and you get the price per mile and per kilometer side by side. Enter the fare and the distance in miles or kilometers. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Ticket price
- 320
- Distance
- 2,450
- Distance unit
- Mi
- Distance mi
- 2,450
- Distance km
- 3,942.8928
- Price per mile
- 0.1306122449
- Price per km
- 0.0811586863
Cheap headline fares are not always the best value once you normalize by how far the plane actually flies. This flight price per mile calculator takes a ticket price and a route distance in miles or kilometers and returns cost per mile and cost per kilometer so you can compare itineraries on a fair, distance-adjusted scale. The arithmetic is exact and deterministic: the international statute mile equals 1.609344 kilometers, both distance forms are always computed, and price is divided by each. Zero distance is rejected with a clear validation error so clients never see Infinity or NaN.
Where flight price-per-mile calculators show up in real work
Corporate travel desks and booking bots rank preferred routes with a simple unit-rate floor so expense policies stay fair across short hops and long hauls without hard-coding every city pair. Travel bloggers and deal newsletters publish fare-value tables and need reproducible examples for screenshots and auto-graded quizzes where the same three inputs always yield the same rates.
Loyalty optimizers who already compute cents per award point still want cash fares expressed per mile so a paid ticket and an award ticket sit on the same distance-normalized scale before they burn a transfer bonus. If you later need live fare scraping, multi-currency conversion, airport-pair great-circle lookup, or award-point valuation, treat those as separate search intents and landings rather than overloading this flight price per mile calculator page.
The SEO slug targets people searching for a flight price per mile calculator who already know their ticket total and route distance and only need the unit-rate math done correctly and quickly.
What you can do with it
Compare nonstop versus connection value
Paste each itinerary fare and great-circle distance and rank options by price per mile so a cheap multi-stop does not win on headline price alone.
Deal posts and teaching tables
Generate reproducible cost-per-mile examples for newsletters, loyalty onboarding, and quizzes without float noise or zero-division edge cases.
FAQ
What happens if distance is zero?
Price per mile is undefined when route distance is zero, so the calculator rejects zero instead of returning Infinity or NaN.
What does the flight price per mile calculator cost?
The browser tool is free and runs locally.
Should I include taxes and fees in the ticket price?
Include taxes and mandatory fees when you want an all-in rate per mile. Use the base fare alone when you only want to compare the air portion between airlines.
Where do I find the route distance?
Use the great-circle distance or the distance the airline publishes for the route. If you only have airport codes, look the distance up with a separate tool and type the number here; this one does not search maps.
How do I compare a nonstop with a connecting itinerary?
Enter each option's fare and its distance, then rank them by price per mile. That way a cheap trip with several stops does not win on headline price alone.
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/flight-price-per-mile \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"ticket_price":320,"distance":2450,"distance_unit":"mi"}'const res = await fetch("https://api.kit.forhosting.com/travel/flight-price-per-mile", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"ticket_price": 320,
"distance": 2450,
"distance_unit": "mi"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/travel/flight-price-per-mile",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"ticket_price": 320,
"distance": 2450,
"distance_unit": "mi"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/travel/flight-price-per-mile", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"ticket_price":320,"distance":2450,"distance_unit":"mi"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"ticket_price":320,"distance":2450,"distance_unit":"mi"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/travel/flight-price-per-mile", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"ticket_price": 320,
"distance": 2450,
"distance_unit": "mi"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "travel.flight_price_per_mile",
"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
Pricing for successful API calls is the published base of $0.002 per item; failed validation is not charged.
How flight cost per mile and per kilometer are calculated
Start from a concrete itinerary you can price and measure: a published ticket total and a great-circle or carrier-published route distance. The calculator first converts the input distance into both units using the exact international statute mile factor of 1.609344 kilometers per mile, the same constant used by standard length converters. Negative distances, negative ticket prices, missing fields, non-finite values such as NaN or Infinity, and unknown unit strings also fail early. When you have only airport codes, resolve the great-circle distance offline or with a separate geo tool and paste the number here—this capability deliberately does not call maps APIs so results stay reproducible and free of network variance. Enter ticket_price as a finite non-negative amount in major currency units such as dollars or euros—include taxes and mandatory fees when you want an all-in unit rate, or use base fare alone when you are comparing only the air portion across carriers. Enter distance as a positive number, and set distance_unit to mi for statute miles or km for kilometers. It then divides ticket_price by distance in miles to obtain price_per_mile, and by distance in kilometers to obtain price_per_km. Because both rates always appear in the response, a North American traveler who thinks in miles and a European traveler who thinks in kilometers can share one JSON object without a second conversion step. If distance is exactly zero the division is undefined, so the capability throws invalid_input with a message that price per mile cannot be computed when route distance is zero.
What you send and what you get back
Classic checks include a three-hundred-twenty dollar fare over two thousand four hundred fifty miles, which produces a clear cents-scale price per mile you can compare with another routing that is longer but cheaper on the headline fare. Wire the free browser form for one-off booking decisions, then call the identical contract from scripts when you score dozens of scraped fare-and-distance pairs into a bulk value table. Send three required fields. ticket_price is a finite number greater than or equal to zero in major currency units; aliases price, fare, and cost are accepted. distance is a finite number strictly greater than zero representing route length. distance_unit is the closed enum mi or km; friendly aliases such as mile, miles, kilometer, and kilometres are normalized, while anything else fails with invalid_input. JSON strings that parse as numbers are accepted the same way as numeric literals for the two numeric fields. Missing any field, empty strings, NaN, Infinity, negative price, zero or negative distance, and unrecognized units all fail with invalid_input and are not charged. On success the response echoes the cleaned ticket_price, distance, and distance_unit, the dual distances distance_mi and distance_km, the dual rates price_per_mile and price_per_km, the constant km_per_mi of 1.609344, the method label ticket_price_over_distance, and a human-readable formula string. Pricing for successful API calls is the published base of $0.002 per item; validation failures do not consume prepaid balance. Downstream tools can threshold on price_per_mile alone, store the full object for audit, or map currency fields into multi-currency reports after converting major units with a separate FX step this capability deliberately does not perform.
Where flight price-per-mile calculators show up in real work
Leisure travelers comparing a nonstop and a one-stop often need more than the lowest listed fare: a slightly more expensive nonstop can still win on time, but a much longer multi-stop routing should look expensive per mile if the savings are tiny. Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.
Integration use cases
Bulk fare-value scoring
Pipe scraped ticket prices and route distances into the API and sort hundreds of city pairs by price_per_mile with one deterministic formula.
Technical questions
How is flight price per mile calculated?
price_per_mile = ticket_price ÷ distance_mi and price_per_km = ticket_price ÷ distance_km. Distance is converted both ways with the exact factor 1 mi = 1.609344 km before dividing.
Should I include taxes in ticket_price?
Include taxes and mandatory fees when you want an all-in unit rate. Use base fare alone when you are comparing only the air portion across carriers. The formula always divides the single ticket_price field you send.
Can I enter distance in kilometers?
Yes. Set distance_unit to km. The response still returns both distance_mi and distance_km and both unit rates so you can compare with mile-based listings.