🔍 Convert Snowflake ID to Unix Timestamp
Select platform and enter snowflake ID to extract Unix timestamp
Convert snowflake IDs to Unix timestamps in milliseconds
Select platform and enter snowflake ID to extract Unix timestamp
Converting a snowflake ID to a Unix timestamp is straightforward: select the platform (Twitter, Discord, or Instagram), paste the snowflake ID, and click Convert. Our tool instantly extracts the embedded timestamp and displays it in milliseconds, seconds, and human-readable format.
Snowflake IDs encode timestamps in the first 41 bits. The conversion formula is: (snowflake_id >> 22) + platform_epoch. This right-shifts the ID by 22 bits to extract the timestamp offset, then adds the platform's epoch to get the Unix timestamp.
| Platform | Epoch Date | Epoch (ms) | Example ID | Formula |
|---|---|---|---|---|
| 🐦 Twitter/X | Nov 4, 2010 | 1288834974657 |
1382350606417817604 |
(id >> 22) + 1288834974657 |
| 💬 Discord | Jan 1, 2015 | 1420070400000 |
175928847299117063 |
(id >> 22) + 1420070400000 |
| Jan 1, 1970 | 0 |
2789123456789012345 |
(id >> 22) |
Epoch: 1288834974657 ms
Formula: (id >> 22) + 1288834974657
Twitter IDs contain millisecond-precision timestamps since November 4, 2010
Epoch: 1420070400000 ms
Formula: (id >> 22) + 1420070400000
Discord IDs timestamp from January 1, 2015 midnight UTC
Epoch: 0 ms (Unix epoch)
Formula: (id >> 22)
Instagram uses standard Unix epoch (January 1, 1970)
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.
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
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
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
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.
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
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.
Cause: ID is too large, corrupted, or not a snowflake ID
Solution: Verify the ID is correct. Some IDs may not follow snowflake format.
Processing multiple IDs? Use array mapping for efficiency:
const ids = ['1382350606417817604', '1383000000000000000'];
const timestamps = ids.map(id =>
Number((BigInt(id) >> 22n) + 1288834974657n)
);
Store epoch values as constants for better performance:
const EPOCHS = {
TWITTER: 1288834974657n,
DISCORD: 1420070400000n,
INSTAGRAM: 0n
};
const timestamp = (BigInt(id) >> 22n) + EPOCHS.TWITTER;
Always validate before converting to prevent errors:
function validateSnowflake(id) {
if (!/^\d{15,19}$/.test(id)) {
throw new Error('Invalid snowflake ID');
}
return true;
}
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.
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.
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.
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.
Explore our specialized converters for different platforms