Decode Snowflake ID to Timestamp

📌 Try these popular Twitter IDs:
TWITTER ID
📅 CREATION DATE & TIME
⏱️ UNIX TIMESTAMP

Last updated

What is Twitter Snowflake Timestamp?

Twitter snowflake IDs contain an embedded timestamp in the first 42 bits. This timestamp represents milliseconds since Twitter's custom epoch (November 4, 2010, 01:42:54 UTC). Our decoder extracts this timestamp and converts it to standard Unix time.

How Snowflake Timestamp Decoding Works

Example Timestamp Decodings

Snowflake ID: 1382350606417817604
Timestamp: 1618414206417 ms
Date: April 14, 2021, 15:30:06 UTC

Twitter Snowflake Timestamp Decoder — Examples

The Twitter Snowflake Timestamp Decoder extracts the exact creation timestamp from any Twitter Snowflake ID with millisecond precision. Here are complete examples covering all common use cases.

Core Timestamp Extraction

// JavaScript — extract timestamp from Snowflake ID
const TWITTER_EPOCH = 1288834974657n; // Nov 4, 2010 UTC

function extractTimestamp(idStr) {
  const id = BigInt(idStr);
  const timestampMs = (id >> 22n) + TWITTER_EPOCH;
  const date = new Date(Number(timestampMs));
  
  return {
    ms:      timestampMs.toString(),
    seconds: Math.floor(Number(timestampMs) / 1000),
    utc:     date.toUTCString(),
    iso8601: date.toISOString()
  };
}

console.log(extractTimestamp("1529877576591609861"));
# Python — extract timestamp from Snowflake ID
from datetime import datetime, timezone

TWITTER_EPOCH_MS = 1288834974657

def extract_timestamp(id_str):
    id_val = int(id_str)
    ts_ms = (id_val >> 22) + TWITTER_EPOCH_MS
    dt = datetime.fromtimestamp(ts_ms / 1000, tz=timezone.utc)
    
    return {
        "ms": ts_ms,
        "seconds": ts_ms // 1000,
        "utc": dt.strftime("%Y-%m-%d %H:%M:%S UTC"),
        "iso8601": dt.isoformat()
    }

print(extract_timestamp("1529877576591609861"))

Millisecond Precision

// Snowflake timestamps are precise to the millisecond
// This is more precise than Twitter's API created_at field (second precision)

function getMillisecondPrecision(idStr) {
  const id = BigInt(idStr);
  const TWITTER_EPOCH = 1288834974657n;
  const tsMs = (id >> 22n) + TWITTER_EPOCH;
  const date = new Date(Number(tsMs));
  
  return {
    fullTimestamp: date.toISOString(),
    milliseconds: date.getMilliseconds(),
    note: `Created at exactly ${date.getMilliseconds()}ms within the second`
  };
}

// Two IDs from the same second but different milliseconds
const id1 = "1529877576591609861";
const id2 = "1529877576591609900";

console.log(getMillisecondPrecision(id1));
console.log(getMillisecondPrecision(id2));

Ordering Events by Timestamp

# Python — sort events chronologically using Snowflake IDs
# IDs are monotonically increasing, so sorting by ID = sorting by time

TWITTER_EPOCH_MS = 1288834974657

def id_to_timestamp_ms(id_str):
    return (int(id_str) >> 22) + TWITTER_EPOCH_MS

events = [
    {"id": "1529877576591609900", "text": "Reply"},
    {"id": "1529877576591609861", "text": "Original tweet"},
    {"id": "1529877576591609950", "text": "Second reply"},
]

# Sort by ID (equivalent to sorting by timestamp)
sorted_events = sorted(events, key=lambda e: int(e["id"]))

from datetime import datetime, timezone
for event in sorted_events:
    ts_ms = id_to_timestamp_ms(event["id"])
    dt = datetime.fromtimestamp(ts_ms / 1000, tz=timezone.utc)
    print(f"[{dt.strftime('%H:%M:%S.%f')[:-3]}] {event['text']}")

Batch Timestamp Extraction

// JavaScript — batch extract timestamps from a list of IDs
function batchExtractTimestamps(ids) {
  const TWITTER_EPOCH = 1288834974657n;
  
  return ids.map(id => {
    const bigId = BigInt(id);
    const tsMs = (bigId >> 22n) + TWITTER_EPOCH;
    const date = new Date(Number(tsMs));
    
    return {
      id,
      timestamp: date.toISOString(),
      unixMs: tsMs.toString()
    };
  });
}

const ids = [
  "1529877576591609861",
  "1700000000000000000",
  "1800000000000000000",
];

const results = batchExtractTimestamps(ids);
results.forEach(r => console.log(`${r.id} → ${r.timestamp}`));

Reverse: Date to Snowflake ID

// Find the Snowflake ID for a specific moment in time
function dateToSnowflakeId(date) {
  const TWITTER_EPOCH = 1288834974657n;
  const tsMs = BigInt(date.getTime()) - TWITTER_EPOCH;
  
  if (tsMs < 0n) {
    throw new Error("Date is before Twitter's Snowflake epoch");
  }
  
  return (tsMs << 22n).toString();
}

// Example: find the ID for a specific date
const date = new Date("2023-01-01T00:00:00Z");
const id = dateToSnowflakeId(date);
console.log(`Min ID for ${date.toDateString()}: ${id}`);

Analyzing High-Activity Periods

# Python — detect high-activity periods from sequence numbers
# High sequence numbers indicate many IDs generated in the same millisecond

def analyze_activity(tweet_ids):
    """
    Analyze activity levels from sequence numbers in tweet IDs.
    High sequence numbers = high activity on that server.
    """
    sequences = [(int(id_str) & 0xFFF) for id_str in tweet_ids]
    
    avg_seq = sum(sequences) / len(sequences)
    max_seq = max(sequences)
    
    return {
        "count": len(tweet_ids),
        "avg_sequence": round(avg_seq, 1),
        "max_sequence": max_seq,
        "activity_level": (
            "Very High" if avg_seq > 2000 else
            "High" if avg_seq > 500 else
            "Normal"
        )
    }

ids = ["1529877576591609861", "1529877576591609900", "1529877576591609950"]
print(analyze_activity(ids))

Timestamp Formats Reference

  • ISO 8601: 2022-05-26T14:30:00.000Z — best for APIs and data storage
  • UTC string: Thu, 26 May 2022 14:30:00 GMT — human-readable
  • Unix (ms): 1653572200000 — best for JavaScript Date objects
  • Unix (s): 1653572200 — best for most databases and languages
  • Local time: adjusted to the user's timezone — best for display

The timestamp decoder preserves the full millisecond precision of the Snowflake ID. This precision is valuable for fine-grained temporal analysis, ordering events that occurred within the same second, and verifying the exact timing of Twitter activity.

Snowflake ID: 1800000000000000000
Timestamp: 1720612800000 ms
Date: July 10, 2024, 12:00:00 UTC

Why Decode Snowflake Timestamps?

1. Find exact creation time of tweets and accounts

2. Sort Twitter data chronologically

3. Analyze temporal patterns in Twitter activity

4. Verify tweet authenticity by checking timestamps

Frequently Asked Questions

Yes, our Twitter Snowflake Timestamp Decoder 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 uses industry-standard decoding algorithms to ensure 100% accurate results.

If decoding fails, check that your input format is correct. The tool will show error messages to help you fix any issues.