📚 How to Decode Twitter Snowflake ID

Complete step-by-step guide with examples and free tool

What is a Twitter Snowflake ID?

Twitter uses snowflake IDs - unique 64-bit identifiers for tweets, users, direct messages, and other objects. These IDs encode the creation timestamp, making it possible to extract the exact date and time when a tweet was posted or account was created.

Example Twitter ID: 1382350606417817604

This ID was created on: April 14, 2021 at 15:30:06 UTC

Step-by-Step: How to Decode Twitter Snowflake ID

1
Get the Twitter ID
Find the Twitter ID you want to decode. You can get it from:
  • Tweet URL: twitter.com/user/status/1382350606417817604
  • User profile API response
  • Direct message ID
2
Understand the Formula
Twitter snowflake IDs encode the timestamp in the first 42 bits. The formula to extract it:
timestamp_ms = (snowflake_id >> 22) + 1288834974657

Where:

  • >> 22 = Right bit shift by 22 positions
  • 1288834974657 = Twitter epoch (Nov 4, 2010, 01:42:54 UTC)
3
Apply the Formula

Let's decode 1382350606417817604:

1382350606417817604 >> 22 = 329579231760 329579231760 + 1288834974657 = 1618414206417

Result: 1618414206417 milliseconds since Unix epoch

4
Convert to Human-Readable Date

Convert the Unix timestamp (1618414206417 ms) to a date:

Result: Wednesday, April 14, 2021, 15:30:06 UTC

🛠️ Try It Yourself - Free Decoder Tool

Decode Any Twitter ID

Twitter ID:
📅 Creation Date:
⏱️ Unix Timestamp: ms
🕐 Time Ago:

Common Examples

Example 1: Tweet ID 1800000000000000000
Decoded: July 10, 2024, 12:00:00 UTC
Example 2: User ID 2024288437327843509
Decoded: December 15, 2024, 08:45:30 UTC
Example 3: Tweet ID 1382350606417817604
Decoded: April 14, 2021, 15:30:06 UTC

Why Decode Twitter Snowflake IDs?

  • Find Tweet Age: Determine exactly when a tweet was posted
  • Account Creation Date: See when a Twitter account was created
  • Data Analysis: Sort and analyze Twitter data chronologically
  • Verification: Verify the authenticity of tweets by checking timestamps
  • Research: Track trends and events on Twitter by timestamp

Technical Details

Snowflake ID Structure (64 bits)

  • Bits 0-21 (22 bits): Sequence number and machine ID
  • Bits 22-63 (42 bits): Timestamp in milliseconds since Twitter epoch

Twitter Epoch

Twitter's custom epoch starts at: 1288834974657 milliseconds (November 4, 2010, 01:42:54 UTC)

Programming Examples

// JavaScript const TWITTER_EPOCH = 1288834974657n; const id = 1382350606417817604n; const timestamp = Number((id >> 22n) + TWITTER_EPOCH); const date = new Date(timestamp); // Python TWITTER_EPOCH = 1288834974657 id = 1382350606417817604 timestamp = (id >> 22) + TWITTER_EPOCH date = datetime.fromtimestamp(timestamp / 1000)
💙

Support TechConverter

Get $200 free DigitalOcean credit or sponsor us on GitHub!