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)

Last updated

Common Mistakes to Avoid

Use the online decoder at the top of this page for instant results without writing any code.

Examples

Example 1: Understanding the Bit Structure

Twitter Snowflake ID: 1382350606417817604

Binary (64 bits):
0 0001001100110000101001001001001001001001001001001001001000000100

Bit layout:
┌─────────────────────────────────────────────────────────────────┐
│ 0 │ 41 bits (timestamp) │ 5 bits (DC) │ 5 bits (worker) │ 12 bits (seq) │
└─────────────────────────────────────────────────────────────────┘

Decoded:
  Timestamp bits: → milliseconds since Twitter epoch
  Twitter epoch:  1288834974657 (Nov 4, 2010 01:42:54 UTC)
  Datacenter ID:  0-31
  Worker ID:      0-31
  Sequence:       0-4095

Example 2: JavaScript Decoder (using BigInt)

// JavaScript loses precision for integers > 2^53
// Always use BigInt for Twitter Snowflake decoding

const TWITTER_EPOCH = 1288834974657n;

function decodeSnowflake(snowflakeId) {
  const id = BigInt(snowflakeId);

  // Extract timestamp (bits 22-63)
  const timestampMs = Number((id >> 22n) + TWITTER_EPOCH);

  // Extract datacenter ID (bits 17-21)
  const datacenterId = Number((id & 0x3E0000n) >> 17n);

  // Extract worker ID (bits 12-16)
  const workerId = Number((id & 0x1F000n) >> 12n);

  // Extract sequence number (bits 0-11)
  const sequence = Number(id & 0xFFFn);

  return {
    timestamp: new Date(timestampMs),
    timestampMs,
    datacenterId,
    workerId,
    sequence
  };
}

// Usage:
const result = decodeSnowflake('1382350606417817604');
console.log(result.timestamp.toISOString());
// → "2021-04-14T17:05:00.123Z"
console.log(result.datacenterId); // → 0-31
console.log(result.workerId);     // → 0-31
console.log(result.sequence);     // → 0-4095

Example 3: Python Decoder

import datetime

TWITTER_EPOCH = 1288834974657  # milliseconds

def decode_snowflake(snowflake_id: int) -> dict:
    """Decode a Twitter Snowflake ID into its components."""
    # Extract timestamp (right-shift by 22 bits)
    timestamp_ms = (snowflake_id >> 22) + TWITTER_EPOCH
    created_at = datetime.datetime.fromtimestamp(
        timestamp_ms / 1000,
        tz=datetime.timezone.utc
    )

    # Extract datacenter ID (bits 17-21)
    datacenter_id = (snowflake_id & 0x3E0000) >> 17

    # Extract worker ID (bits 12-16)
    worker_id = (snowflake_id & 0x1F000) >> 12

    # Extract sequence number (bits 0-11)
    sequence = snowflake_id & 0xFFF

    return {
        'created_at': created_at,
        'timestamp_ms': timestamp_ms,
        'datacenter_id': datacenter_id,
        'worker_id': worker_id,
        'sequence': sequence
    }

# Usage:
result = decode_snowflake(1382350606417817604)
print(result['created_at'])      # 2021-04-14 17:05:00+00:00
print(result['datacenter_id'])   # 0-31
print(result['worker_id'])       # 0-31
print(result['sequence'])        # 0-4095

Frequently Asked Questions

Yes, our How To Decode Twitter Snowflake Id is completely free with no registration required. Use it unlimited times without any restrictions.

Yes, all processing happens locally in your browser. Your data never leaves your device and is not stored on our servers.

No installation needed. The tool works directly in your web browser on any device.

The tool supports all standard formats. Simply paste your input and the conversion happens instantly.

Yes, you can process multiple conversions by using the tool repeatedly. Each conversion is instant.