Last updated
Key Facts
- Instagram epoch: January 1, 2011 (Unix: 1293840000 seconds)
- Timestamp extracted by right-shifting the ID by 23 bits
- Post IDs are permanent — they never change after creation
- Larger IDs = newer posts (monotonically increasing)
- Always use BigInt in JavaScript to avoid precision loss
- The API returns IDs as strings — store them as strings in your database
Enter any Instagram post ID to instantly decode its creation timestamp. No API access required.
Examples
Example 1: Decoding a Post ID
Instagram Post ID: 2847392847392847392
Decoded result:
Created at: 2023-08-15 14:32:07 UTC
Unix timestamp: 1692109927000 (milliseconds)
Post age: ~1 year, 7 months ago
The post ID encodes:
- Creation timestamp (upper bits)
- Shard ID (middle bits)
- Sequence number (lower bits)
Formula:
timestamp_seconds = (post_id >> 23) + 1293840000
created_at = datetime.fromtimestamp(timestamp_seconds)
Example 2: JavaScript Implementation
const INSTAGRAM_EPOCH = 1293840000; // Jan 1, 2011 (seconds)
function decodePostId(postId) {
// Use BigInt to avoid precision loss with large integers
const id = BigInt(postId);
const timestampSeconds = Number(id >> 23n) + INSTAGRAM_EPOCH;
const createdAt = new Date(timestampSeconds * 1000);
return {
createdAt,
timestampSeconds,
iso: createdAt.toISOString(),
readable: createdAt.toLocaleString('en-US', {
timeZone: 'UTC',
year: 'numeric',
month: 'long',
day: 'numeric',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
timeZoneName: 'short'
})
};
}
// Example:
const info = decodePostId('2847392847392847392');
console.log(info.iso); // "2023-08-15T14:32:07.000Z"
console.log(info.readable); // "August 15, 2023 at 02:32:07 PM UTC"
Example 3: Python Implementation
import datetime
INSTAGRAM_EPOCH = 1293840000 # Jan 1, 2011
def decode_post_id(post_id: int) -> dict:
timestamp_seconds = (post_id >> 23) + INSTAGRAM_EPOCH
created_at = datetime.datetime.fromtimestamp(
timestamp_seconds,
tz=datetime.timezone.utc
)
now = datetime.datetime.now(tz=datetime.timezone.utc)
age = now - created_at
return {
'created_at': created_at,
'timestamp_seconds': timestamp_seconds,
'age_days': age.days,
'formatted': created_at.strftime('%B %d, %Y at %H:%M:%S UTC')
}
# Usage:
result = decode_post_id(2847392847392847392)
print(result['formatted'])
# → "August 15, 2023 at 14:32:07 UTC"
print(f"Post is {result['age_days']} days old")