Skip to content

Unix Timestamp Converter (s, ms, µs, ns)

Paste any epoch value — seconds through nanoseconds, single or batch.

Buğra SözeriDeveloper
Published

A Unix timestampis a count of elapsed time since the epoch (midnight UTC on 1 January 1970). Different systems write it at different resolutions: shells and most REST APIs use seconds, JavaScript and Java use milliseconds, modern databases like Postgres use microseconds, and Go’s time.Now().UnixNano() plus systems like ClickHouse use nanoseconds. This tool auto-detects the unit from the digit count, preserves sub-millisecond precision in the ISO 8601 output, and accepts a newline-separated batch so you can paste a column straight out of a log file. If you just want a quick point-and-click converter, the simpler datetime timestamp tool covers the common cases.

now = 0

Paste timestamps above. The tool auto-detects the unit from the digit count: 10 = seconds, 13 = milliseconds, 16 = microseconds, 19 = nanoseconds.

All parsing runs in your browser — nothing is uploaded. Sub-millisecond precision is preserved in the ISO 8601 row; the JavaScript Date object underneath is millisecond-resolution, so the UTC / local strings round to the nearest millisecond.

How to use

  1. Paste one or many timestamps

    Drop a single epoch value, or paste a column from a log file or spreadsheet — one timestamp per line. Mixed units in the same batch are fine; each line is detected independently.

  2. Let the tool detect the unit

    Detection is by digit count: 10 digits is seconds, 13 is milliseconds, 16 is microseconds, 19 is nanoseconds. The detected unit is shown as a pill next to each line.

  3. Copy the format you need

    Every row exposes ISO 8601 (UTC, up to nanosecond precision), RFC 3339 (with local offset), UTC string, local string, normalized seconds and milliseconds, and a human-readable relative phrase. Each value has its own copy button.

  4. Share a single value

    The first line is mirrored into the URL as ?t=…, so a deep link reproduces the conversion exactly.

Frequently asked questions

How does the unit auto-detection work?
It counts digits. A 10-digit positive integer is seconds (good through the year 2286), 13 digits is milliseconds, 16 is microseconds, and 19 is nanoseconds. Negative values (pre-1970) work the same way after stripping the sign.
When should I use ns versus ms?
Use milliseconds when you only need wall-clock accuracy and the value will land in a Date / Instant / Timestamp object — that is most application code. Use microseconds or nanoseconds when ordering matters at sub-millisecond resolution: tracing spans, metrics ingestion, columnar databases like ClickHouse, and Go services calling time.Now().UnixNano(). Storing nanoseconds when you only need seconds wastes index space and complicates joins across systems that downsample.
What’s the year-2038 problem?
Systems that store Unix seconds in a signed 32-bit integer overflow at 03:14:07 UTC on 19 January 2038 — the value 2_147_483_647 + 1 wraps to a large negative number. The fix is to use a 64-bit integer (or unsigned 32-bit if you only care about the future), which every modern language and database already does. This tool internally uses BigInt, so it has no 2038 cliff.
Does this preserve nanosecond precision?
Yes in the ISO 8601 row, which is built from BigInt arithmetic and can show all nine fractional-second digits. The UTC string and local string rows are formatted by JavaScript’s Date, which is millisecond-resolution, so anything sub-millisecond rounds in those rows.
What about leap seconds?
Unix time, by design, ignores them — every day is treated as 86_400 seconds even when UTC has inserted a leap second. See the glossary entry on the leap second for the longer story. If you need true UTC including leap seconds, you need TAI or a leap-second-aware library, not a plain epoch value.
Is anything sent to a server?
No. Parsing, BigInt math, and formatting all run in your browser. The page makes no network requests when you paste a timestamp.

About

Why a developer-grade variant

The /datetime/timestamp/ tool is built for non-technical users — one timestamp, one wall-clock answer. This page targets the engineer who has a log line, a database export, or a trace span and needs to know the unit, the precision, the UTC and local renderings, and the relative age all at once. Batch input means you can convert a whole column without scripting.

Choosing a wire format

For new APIs, prefer ISO 8601 / RFC 3339 strings: they self-describe, round-trip unambiguously across languages, and survive timezone changes on the receiver. Use epoch integers when bandwidth or column width is tight (telemetry, metrics, columnar stores). When you do use epoch, pick a single resolution per system — mixing seconds and milliseconds in the same column is the most common bug this tool exists to debug.

Related guide

Where the “1970-01-01 UTC” epoch comes from, why milliseconds vs seconds is the bug you keep shipping, and how leap seconds quietly break naive timestamp math — the explainer walks the full history and modern conventions.

Read: Unix timestamp explained →