Cookie Expiration Calculator
Enter when a cookie is set and how long it lasts to get its expiry as a date and Unix timestamp, or convert a max-age value between seconds and days.
- ISO expiration
- 2026-12-31
- Local date
- 12/31/2026
- Unix (seconds)
- 1798675200
- Days remaining
- 90
Expires within 90 days
= 90.00 days
Runs in your browser. Nothing you enter is uploaded.
What it does
Cookie banners and privacy policies are supposed to state how long each cookie lives, but tag vendors quote lifetimes in days, months or raw seconds. This calculator turns a set date plus a duration into an expiry date in ISO, local and Unix formats, and shows how many days remain from today.
A separate converter handles max-age values from HTTP headers or tag settings, going from seconds to days or the reverse. You can also add several cookies with their own durations to see all their expiry dates from the same set date.
How to use it
- 1
Click a Cookie presets button (for example Google Analytics (_ga) at 730 days) or skip it.
- 2
Set the Set date, then enter a Duration and choose Days, Months or Years in Unit.
- 3
Read the ISO expiration, Local date, Unix (seconds) and Days remaining results and the status line below them.
- 4
For header values, choose Seconds to Days or Days to Seconds and type into the TTL field.
- 5
Optionally click + Add cookie to add batch rows with a name and days each.
What you get
Four figures for the main cookie (ISO date, local date, Unix seconds, days remaining) with a colour-coded status, a single TTL conversion, and an expiry date plus days left for each batch row.
When to use it
- Filling in a cookie policy table
- Use a preset or duration to get the exact expiry date and days remaining for each tracking cookie you list.
- Reading a max-age header
- Paste a value like 7776000 into the TTL box to confirm it equals 90 days before documenting it.
- Comparing several tags at once
- Add a batch row per cookie with its lifetime in days to see which expire soon (red within 30 days, amber within 90).
- Setting a cookie in code
- Convert a lifetime in days to seconds for a max-age attribute, or copy the Unix timestamp for an expires value.
Example
Input
Set date 2026-10-01, preset Google Analytics (_ga), which sets Duration to 730 days
Output
Local date: 30 September 2028. Days remaining is counted from today and the status reads Healthy expiration window while more than 90 days are left.
The TTL converter defaults to 7776000 seconds, which it shows as 90.00 days.
Tips
- The preset lifetimes are the reference values built into the tool. Check your own tag configuration, since vendors let you change cookie duration.
- The ISO expiration is shown in UTC, so if you are east of UTC it can read one day earlier than the Local date. Quote the one that matches your policy format.
- Month and year durations follow the calendar (a month from 31 January lands in early March), so use days when you need an exact count.
- Batch rows always count in days from the main Set date, so change the Set date first if you're documenting cookies set at a different time.
Questions
How do I convert a cookie max-age in seconds to days?
Choose Seconds to Days and type the value. The tool divides by 86,400 (the seconds in a day) and shows the result to two decimals.
How long does the Google Analytics _ga cookie last by default?
The tool's preset uses 730 days for _ga and 1 day for _gid. Your site's actual value depends on the cookie_expires setting in your tag, so confirm it there.
Why does the days remaining figure turn red or amber?
The panel turns red when 30 days or fewer remain and amber when 90 days or fewer remain. It reads "Cookie has expired" when the date has passed.
Can I document multiple cookies with one set date?
Yes. Click + Add cookie for each one, give it a name and a lifetime in days, and each row shows its own expiry date and days left.
Related tools
Related tools
