📸 Instagram Short Code Number Converter

Convert Instagram shortcodes to numeric media IDs and vice versa

Convert Shortcode ↔ Media ID

📌 Try these examples:
INPUT
SHORTCODE
MEDIA ID (NUMBER)

What is an Instagram Short Code Number?

Instagram uses shortcodes in post URLs to make them shorter and more user-friendly. Each shortcode is a base64-encoded representation of a numeric media ID. For example, shortcode 'CK1JqHqFVOy' represents media ID 2501040375429168306.

How Instagram Shortcodes Work

Instagram's Custom Base64 Alphabet:

ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_

Instagram uses a URL-safe base64 variant with '-' and '_' instead of '+' and '/'.

Convert Shortcodes in Code

JavaScript
// JavaScript
const ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';

function shortcodeToMediaId(shortcode) {
  let mediaId = 0n;
  for (const char of shortcode) {
    mediaId = mediaId * 64n + BigInt(ALPHABET.indexOf(char));
  }
  return mediaId.toString();
}

function mediaIdToShortcode(mediaId) {
  let id = BigInt(mediaId);
  let shortcode = '';
  while (id > 0n) {
    shortcode = ALPHABET[Number(id % 64n)] + shortcode;
    id = id / 64n;
  }
  return shortcode;
}

// Example
console.log(shortcodeToMediaId('CK1JqHqFVOy')); // 2501040375429168306
console.log(mediaIdToShortcode('2501040375429168306')); // CK1JqHqFVOy

Common Use Cases

🔗 Related Snowflake ID Tools

🐦 Twitter Snowflake Decoder 💬 Discord Snowflake Decoder 📸 Instagram Snowflake Decoder

📚 Learn More About Snowflake IDs

How to Decode Tutorial Real ID Examples Snowflake Calculator ID to Timestamp