Calculate parking fee by duration
Park for 5.5 hours at 4 for the first hour and 2.5 for each extra started hour, and you are billed 6 hours for 16.5, under an 18 daily cap. Check a garage estimate before you pay. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Duration hours
- 5.5
- First hour fee
- 4
- Additional hour rate
- 2.5
- Daily max
- 18
- Total fee
- 16.5
- Billed hours
- 6
- Full days
- 0
- Remaining hours
- 5.5
This parking fee calculator turns a posted rate structure and a parking duration into one predictable total. Enter the flat first-hour fee, the rate for every additional started hour, the daily maximum, and the total duration in hours. The calculator bills each started hour, caps every complete or partial 24-hour parking period independently, and shows the billed hours and cap usage behind the result. It is useful for drivers checking a garage estimate and for software teams testing parking-payment logic without relying on a clock, location service, or external pricing feed.
Translate the parking sign into four inputs
Start with the duration in hours, including a decimal when the stay includes minutes: ninety minutes is 1.5 hours, while three hours and fifteen minutes is 3.25 hours. Then copy the first-hour fee, the additional-hour rate, and the daily maximum from the garage's posted tariff. Use one currency consistently because the calculator performs arithmetic and does not convert currencies or attach a currency symbol.
A zero duration returns a zero fee. For any positive duration, the first started hour triggers the first-hour fee. Time beyond that first hour is charged at the additional rate for every started hour, so 1.01 hours occupies two billable hours.
This explicit started-hour convention avoids an ambiguous prorated answer when a tariff simply says “per hour.” All four numeric fields must be finite and non-negative. Negative fees and negative caps are rejected for the same reason: they do not describe a usable customer charge under this rate model.
Understand hourly billing and the daily maximum
The algorithm divides the stay into complete 24-hour parking periods plus one possible remainder. Within each period it first calculates the uncapped hourly charge: the first started hour uses the flat fee and every later started hour uses the additional rate. It then selects the smaller of that charge and the daily maximum.
A complete 24-hour period is therefore charged at the lesser of the daily maximum or the first-hour fee plus twenty-three additional hourly charges. A partial period follows exactly the same rule, beginning again with its own first-hour fee. For example, a 27.25-hour stay contains one complete 24-hour period and a 3.25-hour remainder.
The remainder occupies four started hours: one at the flat fee and three at the additional rate, subject to its own cap. The response reports the number of complete days, uncapped remainder hours, total billed hours, and how many periods actually exceeded the maximum. The comparison is strict: when the hourly calculation equals the maximum, the final price is the same but the cap-applied counter remains zero because the maximum did not reduce the charge.
What you can do with it
Check a garage estimate
Compare a planned stay with the posted first-hour, additional-hour, and maximum rates before choosing a facility.
Reconcile parking expenses
Recompute a simple receipt from its duration and tariff while retaining an explanation of billed hours and capped periods.
FAQ
How are partial hours billed?
Every started hour is billed. For example, 2.1 hours counts as three billed hours within its 24-hour period.
How does the daily maximum work for stays longer than one day?
The stay is split into consecutive 24-hour periods from entry, and the maximum is applied independently to each complete or partial period.
Does this calculator support grace periods or special rates?
No. It models one first-hour fee, one additional started-hour rate, and one maximum per 24-hour period.
What currency does the result use?
It uses whichever currency unit you use consistently for all three fee inputs; no currency conversion is performed.
How do I enter a stay that includes minutes?
Write the time as decimal hours: 90 minutes is 1.5 hours and three hours and fifteen minutes is 3.25. Every started hour counts, so even 1.01 hours is billed as two hours.
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/parking-fee-duration-calc \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"duration_hours":5.5,"first_hour_fee":4,"additional_hour_rate":2.5,"daily_max":18}'const res = await fetch("https://api.kit.forhosting.com/travel/parking-fee-duration-calc", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"duration_hours": 5.5,
"first_hour_fee": 4,
"additional_hour_rate": 2.5,
"daily_max": 18
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/travel/parking-fee-duration-calc",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"duration_hours": 5.5,
"first_hour_fee": 4,
"additional_hour_rate": 2.5,
"daily_max": 18
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/travel/parking-fee-duration-calc", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"duration_hours":5.5,"first_hour_fee":4,"additional_hour_rate":2.5,"daily_max":18}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"duration_hours":5.5,"first_hour_fee":4,"additional_hour_rate":2.5,"daily_max":18}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/travel/parking-fee-duration-calc", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"duration_hours": 5.5,
"first_hour_fee": 4,
"additional_hour_rate": 2.5,
"daily_max": 18
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "travel.parking_fee_duration_calc",
"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
Translate the parking sign into four inputs
In particular, a negative duration is treated as bad source data and returns an invalid_input error rather than being converted to its absolute value.
Use the result responsibly in estimates and software
Here, a “day” is always a consecutive 24-hour parking period measured from entry, which keeps the calculation deterministic. Confirm that this matches the facility's posted terms before treating the result as an invoice. Store the original tariff beside the response when prices may change, and add separate business rules upstream if a facility prorates partial hours or resets its daily maximum at a fixed local time. Use total_fee as the computed charge in the same currency unit as the three submitted rates. For API automation, successful requests use the published base price of $0.002 per item, while the browser can use the same pure calculation.
Integration use cases
Test parking payment software
Create deterministic fixtures for started-hour billing, 24-hour boundaries, and daily-cap behavior.
Technical questions
What happens when the duration is negative?
The request fails with an invalid_input error because a negative parking duration is not valid for this calculation.
What does an API calculation cost?
A successful API request costs $0.002 per item.