Shortcode to Timestamp Converter

Conversion Result

Shortcode
Media ID
Unix Timestamp (seconds)
Unix Timestamp (milliseconds)
ISO 8601 Format
📅 Human Readable Date

Try These Examples

CwkxyiVP2MU
📅 July 23, 2023
C5pqrXYZ123
📅 January 15, 2024
DAbcdefGHIJ
📅 June 10, 2024

Understanding Timestamp Formats

Unix Timestamp (Seconds)

Number of seconds since January 1, 1970 (Unix epoch). Example: 1690123456

Unix Timestamp (Milliseconds)

Number of milliseconds since Unix epoch. Example: 1690123456000

ISO 8601 Format

International standard date format. Example: 2023-07-23T12:34:16.000Z

Human Readable

Easy-to-read format. Example: Sun Jul 23 2023 12:34:16 GMT+0000 (UTC)

How It Works

Instagram shortcodes encode the media ID using a custom Base64 alphabet. The conversion process:

  1. Decode the shortcode from Base64 to get the media ID
  2. Right shift the media ID by 22 bits to extract the timestamp
  3. Convert the timestamp to various formats (Unix, ISO, human-readable)

Pro Tip

Instagram reels and posts use the same shortcode format. This tool works for both!

Common Use Cases

Use Case Best Format Why
Database Storage Unix Timestamp (seconds) Compact, easy to sort and compare
JavaScript/APIs Unix Timestamp (milliseconds) JavaScript Date() uses milliseconds
Data Exchange ISO 8601 International standard, timezone-aware
Display to Users Human Readable Easy to understand at a glance

Frequently Asked Questions

What's the difference between date and timestamp?

A timestamp is a numeric representation (seconds or milliseconds since Unix epoch), while a date is a human-readable format. Timestamps are better for calculations and storage.

Can I convert Instagram post shortcodes too?

Yes! Instagram posts and reels use the same shortcode format. This tool works for both.

Why are there two Unix timestamp formats?

Unix timestamps can be in seconds or milliseconds. Seconds are more common in databases, while milliseconds are used in JavaScript and provide higher precision.

Is the timestamp accurate?

Yes, the timestamp is encoded directly in the media ID by Instagram's servers. It's accurate to the second.

Last updated

Output Format Reference

Paste any Instagram Reel URL or shortcode to instantly get the Unix timestamp and creation date. No API access or authentication required.

Examples

Example 1: Finding the Shortcode in a Reel URL

Instagram Reel URL format:
  https://www.instagram.com/reel/SHORTCODE/

Example:
  https://www.instagram.com/reel/CxYz123abcd/
  Shortcode: CxYz123abcd

Steps to get the shortcode:
  1. Open the Reel in Instagram
  2. Tap the three dots (⋯) → Copy Link
  3. The copied URL contains the shortcode after /reel/
  4. Paste the full URL or just the shortcode into the converter

Example 2: Conversion Process Explained

Shortcode: "CxYz123abcd"

Step 1: Base64 decode to numeric ID
  Instagram alphabet: A-Z=0-25, a-z=26-51, 0-9=52-61, -=62, _=63

  C → 2
  x → 49
  Y → 24
  z → 51
  1 → 53
  2 → 54
  3 → 55
  a → 26
  b → 27
  c → 28
  d → 29

  Numeric ID = sum of (value × 64^position_from_right)
  Result: 2950000000000000000 (example)

Step 2: Extract timestamp
  timestamp_seconds = (2950000000000000000 >> 23) + 1293840000
  created_at = new Date(timestamp_seconds * 1000)
  Result: 2023-11-20 09:15:42 UTC

Output formats:
  Unix timestamp (seconds): 1700471742
  Unix timestamp (ms):       1700471742000
  ISO 8601:                  2023-11-20T09:15:42.000Z
  Human-readable:            November 20, 2023 at 09:15:42 UTC

Example 3: JavaScript Implementation

const INSTAGRAM_EPOCH = 1293840000;
const ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';

function reelShortcodeToTimestamp(shortcodeOrUrl) {
  // Extract shortcode from URL if needed
  const match = shortcodeOrUrl.match(/\/reel\/([A-Za-z0-9_-]+)/);
  const shortcode = match ? match[1] : shortcodeOrUrl;

  // Base64 decode to numeric ID
  let mediaId = 0n;
  for (const char of shortcode) {
    const value = ALPHABET.indexOf(char);
    if (value === -1) throw new Error(`Invalid character: ${char}`);
    mediaId = mediaId * 64n + BigInt(value);
  }

  // Extract timestamp
  const timestampSeconds = Number(mediaId >> 23n) + INSTAGRAM_EPOCH;
  const createdAt = new Date(timestampSeconds * 1000);

  return {
    shortcode,
    mediaId: String(mediaId),
    unixSeconds: timestampSeconds,
    unixMs: timestampSeconds * 1000,
    iso: createdAt.toISOString(),
    createdAt
  };
}

// Usage:
const result = reelShortcodeToTimestamp('CxYz123abcd');
console.log(result.unixSeconds); // 1700471742
console.log(result.iso);         // "2023-11-20T09:15:42.000Z"

// Works with full URLs too:
const result2 = reelShortcodeToTimestamp('https://www.instagram.com/reel/CxYz123abcd/');
console.log(result2.iso); // Same result

Frequently Asked Questions

Yes, our Instagram Reel Shortcode To Timestamp Converter 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.