Last updated
How to Use Twitter Snowflake ID Decoder
Twitter uses Snowflake IDs for tweets, users, and direct messages. Every Twitter ID contains the creation timestamp encoded in the first 41 bits. Simply paste any Twitter user ID or tweet ID above to see when it was created.
How to Get Twitter IDs
Method 1: From Tweet URLs
twitter.com/user/status/1382350606417817604
The number at the end is the tweet ID. Copy it and paste into the decoder above.
Method 2: From Twitter API
Use Twitter API v2 endpoints to get user IDs and tweet IDs from API responses. The id field contains the Snowflake ID.
Method 3: Browser Developer Tools
Open browser DevTools (F12), go to Network tab, interact with Twitter, and inspect API responses to find user IDs and tweet IDs.
Twitter Snowflake Decoder — Examples
The Twitter Snowflake Decoder extracts the creation timestamp, datacenter ID, worker ID, and sequence number from any Twitter Snowflake ID. Here are complete examples in multiple languages.
JavaScript Decoder
// Full Snowflake decoder in JavaScript
// BigInt is required — Twitter IDs exceed Number.MAX_SAFE_INTEGER
const TWITTER_EPOCH = 1288834974657n; // Nov 4, 2010 01:42:54 UTC
function decodeSnowflake(idStr) {
const id = BigInt(idStr);
const timestampMs = (id >> 22n) + TWITTER_EPOCH;
const datacenterId = Number((id >> 17n) & 0x1Fn);
const workerId = Number((id >> 12n) & 0x1Fn);
const sequence = Number(id & 0xFFFn);
const date = new Date(Number(timestampMs));
return {
id: idStr,
timestamp: {
ms: timestampMs.toString(),
seconds: Math.floor(Number(timestampMs) / 1000),
utc: date.toUTCString(),
iso8601: date.toISOString()
},
datacenterId,
workerId,
sequence
};
}
// Test with a real ID
const result = decodeSnowflake("1529877576591609861");
console.log(result);
Python Decoder
# Full Snowflake decoder in Python
from datetime import datetime, timezone
TWITTER_EPOCH_MS = 1288834974657 # Nov 4, 2010 01:42:54 UTC
def decode_snowflake(id_str):
id_val = int(id_str)
timestamp_ms = (id_val >> 22) + TWITTER_EPOCH_MS
datacenter_id = (id_val >> 17) & 0x1F
worker_id = (id_val >> 12) & 0x1F
sequence = id_val & 0xFFF
dt = datetime.fromtimestamp(timestamp_ms / 1000, tz=timezone.utc)
return {
"id": id_str,
"timestamp_ms": timestamp_ms,
"unix_seconds": timestamp_ms // 1000,
"utc": dt.strftime("%Y-%m-%d %H:%M:%S UTC"),
"iso8601": dt.isoformat(),
"datacenter_id": datacenter_id,
"worker_id": worker_id,
"sequence": sequence
}
# Test
result = decode_snowflake("1529877576591609861")
for key, val in result.items():
print(f"{key}: {val}")
Verifying Tweet Authenticity
# Verify a tweet's timestamp from its ID (for fact-checking)
import re
from datetime import datetime, timezone
def verify_tweet_timestamp(tweet_url_or_id):
"""
Extract and decode the timestamp from a tweet URL or ID.
The decoded timestamp is objective and cannot be manipulated
(unlike a screenshot showing a date).
"""
# Extract ID from URL if needed
if "twitter.com" in tweet_url_or_id or "x.com" in tweet_url_or_id:
match = re.search(r'/status/(\d+)', tweet_url_or_id)
if not match:
return {"error": "Could not extract tweet ID from URL"}
id_str = match.group(1)
else:
id_str = tweet_url_or_id.strip()
id_val = int(id_str)
ts_ms = (id_val >> 22) + 1288834974657
dt = datetime.fromtimestamp(ts_ms / 1000, tz=timezone.utc)
return {
"tweet_id": id_str,
"created_at": dt.isoformat(),
"date": dt.strftime("%B %d, %Y"),
"time_utc": dt.strftime("%H:%M:%S UTC")
}
# Example
url = "https://twitter.com/user/status/1529877576591609861"
print(verify_tweet_timestamp(url))
Analyzing Sequence Numbers
// High sequence numbers indicate high-activity periods
function analyzeActivity(tweetIds) {
const decoded = tweetIds.map(id => {
const bigId = BigInt(id);
const sequence = Number(bigId & 0xFFFn);
const twitterEpoch = 1288834974657n;
const tsMs = Number((bigId >> 22n) + twitterEpoch);
return { id, sequence, date: new Date(tsMs).toISOString() };
});
const avgSequence = decoded.reduce((sum, d) => sum + d.sequence, 0) / decoded.length;
const maxSequence = Math.max(...decoded.map(d => d.sequence));
return {
count: decoded.length,
avgSequence: avgSequence.toFixed(1),
maxSequence,
// High avg sequence = high activity period
activityLevel: avgSequence > 2000 ? "Very High" : avgSequence > 500 ? "High" : "Normal"
};
}
const ids = ["1529877576591609861", "1529877576591609862", "1529877576591609863"];
console.log(analyzeActivity(ids));
Reconstructing Conversation Timeline
# Sort tweets by ID to get chronological order
# (ID ordering = timestamp ordering for Snowflake IDs)
tweets = [
{"id": "1529877576591609861", "text": "Original tweet"},
{"id": "1529877576591609900", "text": "Reply 1"},
{"id": "1529877576591609850", "text": "Earlier tweet"},
{"id": "1529877576591609950", "text": "Reply 2"},
]
# Sort by ID (equivalent to sorting by timestamp)
sorted_tweets = sorted(tweets, key=lambda t: int(t["id"]))
print("Chronological order:")
for tweet in sorted_tweets:
id_val = int(tweet["id"])
ts_ms = (id_val >> 22) + 1288834974657
from datetime import datetime, timezone
dt = datetime.fromtimestamp(ts_ms / 1000, tz=timezone.utc)
print(f" [{dt.strftime('%H:%M:%S.%f')[:-3]}] {tweet['text']}")
Pre-Snowflake vs Snowflake IDs
// Twitter switched to Snowflake in November 2010
// Pre-Snowflake IDs are sequential integers without embedded timestamps
function classifyId(idStr) {
const id = BigInt(idStr);
const SNOWFLAKE_THRESHOLD = 27000000000n; // approximate boundary
if (id < SNOWFLAKE_THRESHOLD) {
return {
type: "pre-snowflake",
note: "Sequential ID from before Nov 2010 — no timestamp encoded"
};
}
const twitterEpoch = 1288834974657n;
const tsMs = (id >> 22n) + twitterEpoch;
return {
type: "snowflake",
date: new Date(Number(tsMs)).toISOString()
};
}
console.log(classifyId("783214")); // pre-snowflake
console.log(classifyId("1529877576591609861")); // snowflake
Snowflake Component Reference
- Bits 63–22 (41 bits): Timestamp — milliseconds since Twitter's epoch (Nov 4, 2010)
- Bits 21–17 (5 bits): Datacenter ID — 0 to 31
- Bits 16–12 (5 bits): Worker ID — 0 to 31
- Bits 11–0 (12 bits): Sequence — 0 to 4095 per millisecond per worker
The decoder works for all Twitter Snowflake IDs: tweet IDs, user IDs, direct message IDs, and list IDs all use the same format and the same epoch.
Twitter Snowflake Epoch
Twitter's Snowflake epoch starts at November 4, 2010, 01:42:54 UTC (1288834974657 milliseconds). All Twitter IDs encode time relative to this epoch.
💡 Why a custom epoch? Using a recent epoch extends the 41-bit timestamp lifespan by ~69 years from 2010 instead of 1970, allowing IDs to work until ~2079 without overflow.
Twitter Snowflake ID Structure
Common Use Cases
Find Tweet Post Time
Discover exactly when a tweet was posted using its ID. Perfect for fact-checking and timeline verification.
Account Creation Date
Determine when Twitter accounts were created from user IDs. Useful for verifying account age.
Activity Analysis
Analyze Twitter activity timelines by decoding multiple tweet IDs to see posting patterns.
Bot Development
Debug Twitter bot timing issues by verifying when tweets and interactions occurred.
Forensic Analysis
Verify tweet timestamps for legal cases, journalism, or content moderation purposes.
Research & Analytics
Track Twitter trends and viral content spread by analyzing tweet ID timestamps.
Real Twitter ID Examples
ID: 1
First Twitter Snowflake → November 4, 2010, 01:42:54 UTC
ID: 1382350606417817604
Popular example → April 14, 2021, 15:30:06 UTC
ID: 2024288437327843509
Recent tweet → August 15, 2024, 16:23:42 UTC
ID: 1800000000000000000
Round number → June 9, 2024, 08:00:00 UTC
Decode Twitter IDs in Your Code
// JavaScript
function decodeTwitterId(id) {
const TWITTER_EPOCH = 1288834974657n;
const snowflake = BigInt(id);
const timestamp = Number((snowflake >> 22n) + TWITTER_EPOCH);
return new Date(timestamp);
}
// Example usage
const date = decodeTwitterId('1382350606417817604');
console.log(date.toISOString()); // 2021-04-14T15:30:06.657Z
# Python
from datetime import datetime
def decode_twitter_id(snowflake_id):
TWITTER_EPOCH = 1288834974657
timestamp = ((int(snowflake_id) >> 22) + TWITTER_EPOCH) / 1000
return datetime.fromtimestamp(timestamp)
# Example usage
date = decode_twitter_id('1382350606417817604')
print(date.isoformat()) # 2021-04-14T15:30:06.657000
Why Twitter Uses Snowflake IDs
Twitter generates billions of IDs daily across global data centers. Snowflake IDs provide:
- Time-ordered sorting: IDs are naturally sorted by creation time
- Distributed generation: Multiple servers generate IDs without coordination
- High performance: 4+ million IDs per second per machine
- Compact storage: 64-bit integers are smaller than UUIDs
- No collisions: Guaranteed uniqueness across all Twitter servers
Frequently Asked Questions
Q: Can I decode deleted tweet IDs?
A: Yes! Even if a tweet is deleted, you can still decode its ID to see when it was originally posted.
Q: Do retweets have different IDs?
A: Yes, retweets get new Snowflake IDs with timestamps showing when the retweet occurred, not the original tweet time.
Q: Can I decode Twitter DM IDs?
A: Yes, Twitter direct message IDs use the same Snowflake format and can be decoded to see message timestamps.
Q: Is this tool free?
A: Yes, completely free with no signup required. All processing happens in your browser for privacy.