Playlist total duration calculator
This playlist duration calculator adds a list of individual track lengths and returns both the complete running time and the average track length.
Run — free
Enter each duration in seconds, including decimal seconds when timing needs to be precise. The result also includes the number of tracks used in the calculation, making it easy to verify that nothing was omitted. It is useful for video playlists, music queues, course modules, screening programs, podcast collections, and any other ordered group of timed media.
Prepare every track duration in seconds
Collect the duration of each track that belongs in the playlist and convert every value to seconds before submitting the list. Keeping one unit removes ambiguity and makes decimal timing straightforward: three minutes and five and a half seconds becomes 185.5 seconds. Preserve the playlist order if it helps you compare the input with an editor or content management system, although order does not affect either calculation. A duration may be zero, which can represent a placeholder, title card, or item whose runtime has not yet been expanded, but negative values are never valid. Every entry must be an actual finite number rather than a formatted timestamp such as 03:05, a numeric string, infinity, or a missing value. Include all intended tracks exactly once. The calculator deliberately rejects an empty list because a playlist without tracks has no meaningful average track length, and returning zero would hide that input mistake instead of helping you correct it.
Understand the total and average results
The total duration is the sum of every accepted track duration. The average track length is that same total divided by the number of tracks, and track_count reports the divisor so the response can be audited without recounting the input. Both duration results remain in seconds, matching the submitted unit and allowing them to feed another timeline calculation directly. For a human-readable display, you can later convert the total into hours, minutes, and seconds, but retaining seconds is usually safer for automation because it avoids parsing formatted text. Decimal values are supported and results are rounded only to stabilize insignificant floating-point artifacts that can appear in ordinary computer arithmetic. The calculation does not add gaps, transitions, advertisements, introductions, playback-speed changes, or crossfades unless their time is already represented in the supplied numbers. If those elements contribute to the finished runtime, model them as additional durations or adjust the relevant tracks before using this result.
Apply the calculation to planning and quality checks
Use the total runtime to check whether a playlist fits a broadcast slot, lesson period, event session, storage estimate, or viewer time budget before publishing. The average helps describe the collection at a glance and can reveal suspicious input: an unexpectedly short average may indicate that milliseconds were entered as seconds, while an unusually long result may expose a duplicated track or a unit conversion error. In an automated workflow, compare track_count with the number of items returned by your catalog, then record the result beside the playlist revision used to produce it. Because the capability performs deterministic arithmetic without fetching media, it is fast and does not need access to video files, URLs, private libraries, or metadata services. That also means it trusts the durations you provide and cannot discover stale or inaccurate source metadata. Recalculate whenever tracks are added, removed, trimmed, replaced, or retimed, and validate the finished rendered asset separately when exact delivery duration is contractually important.
What you can do with it
Fit a screening schedule
Add every selected video runtime and check the complete program length before assigning a venue slot.
Audit a course playlist
Confirm the lesson count, total viewing commitment, and typical module length from exported duration data.
Validate a publishing workflow
Compare the calculated count and runtime with catalog metadata before a playlist is released.
FAQ
What does an API calculation cost?
Each API request uses the current $0.002 base price. The deterministic calculator can also run in the browser.
Which unit should I use?
Enter every track duration in seconds. Decimal seconds are accepted for subsecond precision.
How is average track length calculated?
The calculator divides the summed duration by the number of entries in the durations list.
What happens when the list is empty?
The request returns an invalid input error because an empty playlist does not have a meaningful average track length.
Does the total include gaps or transitions?
Only supplied durations are included. Add gap time separately, and account for overlaps or playback-rate changes before submitting the list.
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/video/playlist-total-duration \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"durations":[185.5,242,198.25]}'const res = await fetch("https://api.kit.forhosting.com/video/playlist-total-duration", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"durations": [
185.5,
242,
198.25
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/video/playlist-total-duration",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"durations": [
185.5,
242,
198.25
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/video/playlist-total-duration", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"durations":[185.5,242,198.25]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"durations":[185.5,242,198.25]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/video/playlist-total-duration", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"durations": [
185.5,
242,
198.25
]
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "video.playlist_total_duration",
"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.
Limits
max_mb | 500 |
max_minutes | 60 |
max_megapixels | 3.9 |
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. |