Countdown between two dates
From midnight UTC on 1 January 2026 to 01:01:01 on 2 January there are 1 day, 1 hour, 1 minute and 1 second, or 90061 seconds. Enter two dates with times and offsets to get the full countdown. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Start ISO-8601 datetime
- 2026-01-01T00:00:00Z
- End ISO-8601 datetime
- 2026-01-02T01:01:01Z
- From epoch seconds
- 1,767,225,600
- To epoch seconds
- 1,767,315,661
- Total seconds
- 90,061
- Days
- 1
Event planners, product launch pages, exam countdowns, and SLA dashboards all need the same plain answer: how many days, hours, minutes, and seconds remain between two known instants. This countdown between two dates calculator accepts a pair of ISO-8601 datetimes, validates each calendar day and clock field under the Gregorian rules, converts both sides to absolute UTC seconds with pure integer arithmetic, and returns a structured remainder that UIs can render without reimplementing leap years or timezone offsets. Invalid shapes, impossible dates such as February thirtieth, and out-of-range clock components fail with invalid input and are not charged.
Choosing from and to ISO datetimes and what formats are accepted
Send two string fields named from and to. Each value must be an ISO-8601 civil datetime: a four-digit year, month, and day, optionally followed by a time of day with hours, minutes, and seconds. You may append a fractional second part; the engine accepts it for compatibility and truncates to whole seconds for the countdown integers.
A trailing Z means UTC; a numeric offset such as plus zero two colon zero zero or minus zero five colon zero zero shifts the local fields into absolute UTC before subtraction. Date-only values such as two thousand twenty-six hyphen zero six hyphen fifteen are treated as midnight UTC so simple day boundaries work without inventing a time. Years are limited to one through nine thousand nine hundred ninety-nine, months to one through twelve, and days must exist in that month including leap-year February twenty-ninth when applicable.
Hours run zero through twenty-three and minutes and seconds zero through fifty-nine; anything outside those ranges is invalid input rather than silently rolled over.
What you can do with it
Product launch and marketing countdowns
Landing pages set from as campaign open and to as go-live, then render days, hours, minutes, and seconds until release without client-side date libraries.
FAQ
What happens if a datetime is invalid?
Bad ISO shape, impossible calendar days, and out-of-range clock fields are rejected and not charged.
Is the countdown between two dates calculator free?
The browser tool runs free on your device.
Does this use the server wall clock or JavaScript Date?
No. Both instants come from your input strings. The engine uses pure Gregorian and offset arithmetic without Date, network, or randomness, so results are fully deterministic.
What happens if the end date is before the start date?
Days, hours, minutes and seconds stay positive, but the total in seconds turns negative and the result is marked as past. A page can then say overdue instead of remaining.
Can I enter only a date, without a time?
Yes. A date on its own is read as midnight UTC on that day, so simple day boundaries work without having to invent a clock time.
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/date/countdown-between \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"from":"2026-01-01T00:00:00Z","to":"2026-01-02T01:01:01Z"}'const res = await fetch("https://api.kit.forhosting.com/date/countdown-between", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"from": "2026-01-01T00:00:00Z",
"to": "2026-01-02T01:01:01Z"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/date/countdown-between",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"from": "2026-01-01T00:00:00Z",
"to": "2026-01-02T01:01:01Z"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/date/countdown-between", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"from":"2026-01-01T00:00:00Z","to":"2026-01-02T01:01:01Z"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"from":"2026-01-01T00:00:00Z","to":"2026-01-02T01:01:01Z"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/date/countdown-between", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"from": "2026-01-01T00:00:00Z",
"to": "2026-01-02T01:01:01Z"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "date.countdown_between",
"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
The path never touches the wall clock, randomness, or the network, so identical from and to strings always produce identical JSON in continuous integration and in production.
Choosing from and to ISO datetimes and what formats are accepted
Aliases start, begin, and start_date map to from; end, until, end_date, and target map to to, matching common form and API naming. Both fields are required: omitting either, sending a non-string, or passing empty whitespace raises invalid_input that names the missing side.
Reading days hours minutes seconds total_seconds and direction
The fields days, hours, minutes, and seconds are always non-negative and together reassemble the absolute value of that difference, so a one-day one-hour one-minute one-second span yields days one, hours one, minutes one, and seconds one regardless of direction. The field total_seconds is the signed difference to minus from: positive when the end is later, zero when the instants match, and negative when the end is earlier. Flags is_past and is_zero, and the direction label forward, backward, or zero, let dashboards choose copy such as remaining versus overdue without re-deriving the sign.
API usage, pricing, product workflows, and practical limits
Call the free in-browser countdown between two dates tool for launch pages, wedding timers, classroom demos, and support scripts without installing moment libraries or timezone databases. Keep expectations honest: this product measures elapsed civil time between two absolute instants after applying explicit offsets; it does not schedule notifications, load public holiday calendars, or invent the current wall-clock now for you. Source inputs follow the same retention rules as other KIT parse items. Send a JSON body with required string fields from and to in ISO-8601 form. Use the prepaid API when a marketing site, ticketing system, exam platform, or operations dashboard needs a stable contract under KIT balance at $0.002 per successful item; validation failures never consume balance after the engine rejects the request. Pair this endpoint with business-day counters when you only care about weekdays and holidays, or with month-length tools when you first validate calendar fields before building a full timestamp. Authors shipping SDKs can map days, hours, minutes, and seconds straight into four countdown digits and drive overdue styling from is_past using the same response shape in every language binding.
Integration use cases
Exams, events, and registration deadlines
Education and ticketing systems compute remaining time to a fixed ISO deadline and flip UI copy with is_past when registration has closed.
SLA and ops dashboards
Operations tools pass incident open and target resolve instants, store total_seconds for sorting, and show formatted remainders on status boards.
Technical questions
How do I get a countdown between two dates?
Send JSON with from and to as ISO-8601 datetimes (for example from: "2026-01-01T00:00:00Z" and to: "2026-01-02T01:01:01Z"). The response includes days, hours, minutes, seconds, and signed total_seconds.
What if the end is before the start?
The breakdown fields stay non-negative for the absolute span, total_seconds is negative, is_past is true, and direction is backward so UIs can show overdue state.