ThisCalculator

Everyday

Time to Live: Meaning, Uses & How to Answer

Updated · Standard formula, shown below

TTL in minutes 60.00 min
TTL in hours
1.00 h
Result
TTL in days
0.04 d
Result
Time to live
3600 seconds
You entered

“Time to live” (TTL) is a number embedded in a data packet that tells a network device, like a router, how many more hops — or, in some systems, how many more seconds — that packet is allowed to exist before it is discarded. You enter a TTL value when you configure a network, a domain name, or a cache, and the system returns the time (or hop count) after which the data is considered stale or expired. This article explains what TTL means in the three places you are most likely to see it — DNS, IP packets, and HTTP caching — and how to choose a sensible value for each.

Formula

The core formula is a simple unit conversion: TTL (in minutes) = TTL (in seconds) ÷ 60. Similarly, hours = seconds ÷ 3600, and days = seconds ÷ 86400. In all three contexts — DNS, IP, and HTTP — the TTL is ultimately a countdown value, and the formula only changes what unit the countdown is expressed in.

Variables:

  • t — the TTL value you are converting, in seconds.
  • TTL in minutes — useful for DNS records that are often set in minutes (e.g., 300 seconds = 5 minutes).
  • TTL in hours — common for caching static content.
  • TTL in days — used when a TTL is very long, like a year for a stable DNS record.

Worked Example

Using the default value of 3600 seconds (the most common TTL for a DNS record):

  1. Minutes: 3600 ÷ 60 = 60 minutes.
  2. Hours: 3600 ÷ 3600 = 1 hour.
  3. Days: 3600 ÷ 86400 = 0.0417 days (about 1 hour).

The calculator returns 60 minutes, 1 hour, and 0.04 days — exactly matching the steps above.

TTL in DNS: The Most Common Use

When you buy a domain name, the DNS (Domain Name System) records that tell browsers where to find your website each carry a TTL. This value, in seconds, tells recursive resolvers (like your ISP’s DNS server) how long to keep that record in cache before asking the authoritative server again.

For example, if your domain’s A record has a TTL of 3600, a resolver that looks it up at 10:00 will keep the result until 11:00. If you change the IP address of your website at 10:30, some visitors will still go to the old IP until the cached copy expires.

Typical DNS TTL values:

  • 300 seconds (5 min) — used during server migrations or when you expect to change records soon.
  • 3600 seconds (1 hour) — a balanced default for most websites.
  • 86400 seconds (24 hours) — common for stable records like MX (mail) or NS (name server) that rarely change.

Lower TTLs mean faster propagation of changes but more queries to your DNS server (slightly higher load). Higher TTLs reduce load but make changes slow to take effect.

TTL in IP Packets: Hop Limit

In the Internet Protocol (IPv4), the TTL field is a number (0–255) that decreases by 1 every time the packet passes through a router. When it reaches 0, the router discards the packet and typically sends an ICMP “Time Exceeded” message back to the sender. This prevents packets from looping forever if there is a routing misconfiguration.

IPv6 uses the same concept but calls it “Hop Limit.” The default TTL for most operating systems is 64 (or 128 on some older systems). You rarely need to change it, but the ping command uses TTL to show the number of hops to a destination — a TTL of 52 means the packet started at 64 and went through 12 routers.

Common misconception: the IP TTL is not a time in seconds, even though the name says “time.” It is purely a hop count. The name is historical — the original specification intended it as a time limit, but in practice it is always implemented as a hop counter.

TTL in HTTP Caching: Browser and CDN

Web servers send HTTP headers like Cache-Control and Expires that effectively set a TTL for a web resource (an image, CSS file, or API response). The browser or a content delivery network (CDN) stores the resource and reuses it until the TTL expires.

For example, a static image with Cache-Control: max-age=86400 is cached for 24 hours. After that, the browser checks the server to see if the file changed. A longer TTL (e.g., 30 days) improves load speed but means users might see an outdated version if you update the file without changing its filename.

Best practice: use a long TTL (like 1 year) for files that have a version number or hash in their name (e.g., style.v2.css), and a short TTL (like 5 minutes) for HTML pages that change frequently.

How to Choose the Right TTL

Choosing a TTL depends on how quickly you need changes to propagate versus how much load you want on your servers. There is no single correct value, but these guidelines help:

  • For DNS records you are actively changing — use 300 seconds (5 min).
  • For stable DNS records — use 86400 (24 hours) or more.
  • For static files on a website — use 2592000 (30 days) or longer if the filename is versioned.
  • For HTML pages — use 300–600 seconds to avoid serving stale content.
  • For API responses — use 0–60 seconds unless the data is truly immutable.

Remember: lowering a DNS TTL before a migration is a common practice — do it at least 24 hours in advance so old cached records expire before you switch.

Common Mistakes and Misunderstandings

  • Confusing IP TTL with DNS TTL — IP TTL is a hop count; DNS TTL is a time in seconds. They are unrelated.
  • Setting DNS TTL too low permanently — a TTL of 60 seconds on every record increases query load and can slow down lookups slightly for users.
  • Setting DNS TTL too high before a change — if you set a 7-day TTL and then need to change your server IP, all visitors may be stuck with the old IP for a week.
  • Forgetting that HTTP TTL only applies to cached copies — a browser may still revalidate if the user presses refresh, so a long TTL does not guarantee the user never sees a change.
  • Using seconds where the system expects minutes — some control panels ask for TTL in minutes, not seconds. Always check the label.

Frequently Asked Questions

What is a good TTL for DNS?

A TTL of 3600 seconds (1 hour) is a safe default for most websites. It balances propagation speed with server load. If you are about to change a record, lower it to 300 seconds a day in advance, then raise it back after the change is complete.

Does a lower TTL make my website faster?

No. A lower TTL means DNS resolvers cache your records for less time, so they have to query your DNS server more often, which can slightly increase lookup time. A higher TTL generally makes DNS lookups faster because more resolvers have the answer cached.

Why is the IP TTL always a number like 64 or 128?

Those are the default initial TTL values set by operating systems. 64 is common for Linux and macOS, 128 for Windows. The number decreases by 1 per router hop, so a TTL of 52 means the packet started at 64 and passed 12 routers.

Can I set TTL to 0?

For DNS, a TTL of 0 means “do not cache” — every request goes to the authoritative server. It is allowed but rarely used because it defeats the purpose of caching. For IP packets, a TTL of 0 means the packet is discarded immediately, so it will never reach its destination.

What happens when a DNS TTL expires?

The resolver discards the cached record and sends a new query to the authoritative DNS server. The response then gets a fresh TTL, and the cycle repeats. This is how DNS changes eventually propagate worldwide.

Is TTL the same as “time to live” in a message queue?

Some message systems (like RabbitMQ or Kafka) use a TTL to expire messages that are not consumed within a set time. That is a similar concept — a maximum lifetime — but it is not related to network TTL. The calculator above converts seconds to minutes/hours/days, which applies to any TTL expressed in seconds.

Limits of This Calculator

This calculator only converts a TTL value from seconds into minutes, hours, and days. It does not tell you what TTL to set — that depends on your specific use case (DNS, HTTP, or IP). It also does not account for the fact that some systems express TTL in milliseconds or minutes; check the unit before entering a number.

For IP packets, the TTL is not a time at all, so this conversion is meaningless there. Only use this tool when you have a TTL that is genuinely measured in seconds.

Related

Formula used
in t | Time to live | seconds | 3600 | 0
out ttl | TTL in minutes | min | t / 60 | 2
out ttl_h | TTL in hours | h | t / 3600 | 2
out ttl_d | TTL in days | d | t / 86400 | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.