Convert Snowflake ID to Unix Timestamp

Select platform and enter snowflake ID to extract Unix timestamp

📝 Try an example:
Unix Timestamp (milliseconds)
Unix Timestamp (seconds)
Human-Readable Date
ISO 8601 Format

Last updated

Platform Epoch Reference

All conversion happens entirely in your browser. Your Snowflake IDs are never transmitted to any server.

Discord

Epoch: 1420070400000 ms

Formula: (id >> 22) + 1420070400000

Discord IDs timestamp from January 1, 2015 midnight UTC

Instagram

Epoch: 0 ms (Unix epoch)

Formula: (id >> 22)

Instagram uses standard Unix epoch (January 1, 1970)

Understanding Unix Timestamps

Unix timestamps represent time as the number of milliseconds (or seconds) since January 1, 1970, 00:00:00 UTC (the Unix epoch). This format is universal across programming languages and databases, making it ideal for storing and comparing times.

Milliseconds vs Seconds: JavaScript and many modern APIs use milliseconds (13 digits), while traditional Unix systems use seconds (10 digits). Our converter provides both formats for maximum compatibility.

Code Examples

JavaScript
const snowflakeId = 1382350606417817604n;
const twitterEpoch = 1288834974657n;
const timestamp = (snowflakeId >> 22n) + twitterEpoch;
console.log(Number(timestamp)); // 1618592259657

// Convert to Date
const date = new Date(Number(timestamp));
console.log(date.toISOString()); // 2021-04-16T18:30:59.657Z
Python
snowflake_id = 1382350606417817604
twitter_epoch = 1288834974657
timestamp = (snowflake_id >> 22) + twitter_epoch
print(timestamp)  # 1618592259657

# Convert to datetime
from datetime import datetime
date = datetime.fromtimestamp(timestamp / 1000)
print(date.isoformat())  # 2021-04-16T18:30:59.657000

Real Example

Input: 1382350606417817604 (Twitter ID)

Output: 1618592259657 ms

Date: April 16, 2021, 6:30:59 PM UTC

Meaning: This tweet was posted on April 16, 2021 at 6:30 PM

How Snowflake IDs Work

Bits 22-63 (42 bits)
Timestamp
Bits 17-21 (5 bits)
Worker ID
Bits 12-16 (5 bits)
Process ID
Bits 0-11 (12 bits)
Sequence

Snowflake ID Structure (64 bits total)

Snowflake IDs are 64-bit integers that encode multiple pieces of information. The timestamp occupies the first 42 bits (after right-shifting by 22), providing millisecond precision for approximately 139 years from the epoch.

Common Errors & Solutions

Error: "Invalid snowflake ID"

Cause: ID contains non-numeric characters or is too short

Solution: Remove any spaces, letters, or special characters. Valid IDs are 15-19 digits.

Example: abc123 → Invalid | 1382350606417817604 → Valid

Error: "Date is in the year 1970 or 2010"

Cause: Wrong platform selected

Solution: Try different platform options. Twitter uses 2010 epoch, Discord uses 2015, Instagram uses 1970.

Tip: If the date seems way off, switch platforms until you get a reasonable date.

Error: "Date is in the future"

Cause: ID is too large, corrupted, or not a snowflake ID

Solution: Verify the ID is correct. Some IDs may not follow snowflake format.

Performance & Best Practices

Batch Processing

Processing multiple IDs? Use array mapping for efficiency:

JavaScript
const ids = ['1382350606417817604', '1383000000000000000'];
const timestamps = ids.map(id => 
    Number((BigInt(id) >> 22n) + 1288834974657n)
);

Caching Epochs

Store epoch values as constants for better performance:

JavaScript
const EPOCHS = {
    TWITTER: 1288834974657n,
    DISCORD: 1420070400000n,
    INSTAGRAM: 0n
};

const timestamp = (BigInt(id) >> 22n) + EPOCHS.TWITTER;

Input Validation

Always validate before converting to prevent errors:

JavaScript
function validateSnowflake(id) {
    if (!/^\d{15,19}$/.test(id)) {
        throw new Error('Invalid snowflake ID');
    }
    return true;
}

Common Use Cases

Try These Real Examples

🐦 Twitter
1382350606417817604
→ April 16, 2021
💬 Discord
175928847299117063
→ April 30, 2016
📸 Instagram
2789123456789012345
→ March 15, 2022

Frequently Asked Questions

What's the difference between milliseconds and seconds timestamps?

Milliseconds timestamps have 13 digits and provide millisecond precision (used by JavaScript, Discord, Twitter). Seconds timestamps have 10 digits and provide second precision (traditional Unix systems). Divide milliseconds by 1000 to get seconds.

Can I convert timestamps back to snowflake IDs?

Not exactly. While you can create a snowflake ID from a timestamp, you can't recreate the original ID because it also contains worker ID and sequence number. Use our Snowflake Generator to create new IDs.

Why do I need to select a platform?

Each platform uses a different epoch (starting point). Twitter's epoch is 2010, Discord's is 2015, Instagram uses 1970. Selecting the wrong platform will give you an incorrect timestamp by years.

What if my timestamp looks wrong?

Try a different platform option. If the ID is from Twitter but you selected Discord, the timestamp will be off by ~4 years. The correct platform will show a reasonable date.

Related Tools

🐦 Twitter Snowflake to Timestamp
Convert Twitter IDs to timestamps
💬 Discord Snowflake to Date
Convert Discord IDs to dates
📸 Instagram Media ID Decoder
Decode Instagram post IDs
⏰ Unix Timestamp to Date
Convert Unix timestamps to dates

Examples

Example 1: Twitter Snowflake ID to Timestamp

Input: 1529877576591609861
Platform: Twitter (epoch: 1288834974657 ms)

Calculation:
  1529877576591609861 >> 22 = 364745825466
  364745825466 + 1288834974657 = 1653580800123 ms

Output:
  ISO 8601:    2022-05-26T18:00:00.123Z
  UTC:         2022-05-26 18:00:00.123 UTC
  Unix (ms):   1653580800123
  Unix (s):    1653580800
  Relative:    about 2 years ago

Example 2: Discord Snowflake ID to Timestamp

Input: 175928847299117063
Platform: Discord (epoch: 1420070400000 ms)

Calculation:
  175928847299117063 >> 22 = 41943040
  41943040 + 1420070400000 = 1420112343040 ms

Output:
  ISO 8601:    2015-01-01T11:39:03.040Z
  UTC:         2015-01-01 11:39:03.040 UTC
  Unix (ms):   1420112343040
  Account age: ~9 years old (as of 2024)

Example 3: Convert Timestamp to Snowflake ID (Reverse)

Calculate the minimum Snowflake ID for a specific date — useful for database range queries:

Input date: 2024-01-01 00:00:00 UTC
Platform: Twitter

Calculation:
  Unix ms: 1704067200000
  1704067200000 - 1288834974657 = 415232225343
  415232225343 << 22 = 1740000000000000000 (approx)

Result: Min Snowflake ID for 2024-01-01 = ~1740000000000000000

Database query using this:
  SELECT * FROM tweets
  WHERE id >= 1740000000000000000;
  -- Returns all tweets from 2024 onwards
  -- Uses primary key index — very fast!

Frequently Asked Questions

Enter the snowflake ID, select the platform (Twitter, Discord, or Instagram), and click Convert. The tool extracts the embedded timestamp and returns the Unix timestamp in milliseconds.

A snowflake ID is a 64-bit integer containing timestamp, worker ID, and sequence. Unix timestamp is just the time component in milliseconds since epoch. Our converter extracts the timestamp from the snowflake ID.