What Are Instagram Short Codes?
Instagram short codes (shortcodes) are the alphanumeric identifiers in Instagram URLs that uniquely identify posts, reels, and IGTV videos.
https://instagram.com/p/CXhfQ9OgFjP/
✅ The highlighted part is the Instagram shortcode
Where to Find Instagram Shortcodes
📷 Regular Posts
instagram.com/p/SHORTCODE/
🎬 Reels
instagram.com/reel/SHORTCODE/
📺 IGTV Videos
instagram.com/tv/SHORTCODE/
Shortcode Format
Instagram shortcodes have specific characteristics:
- Length: Typically 11 characters
- Characters: Letters (A-Z, a-z), numbers (0-9), underscore (_), hyphen (-)
- Case-sensitive: CXhfQ9OgFjP ≠ cxhfq9ogfjp
- Unique: Each shortcode identifies exactly one post
- Permanent: Shortcodes don't change over time
How Instagram Shortcodes Work
Instagram shortcodes are base64url encoded representations of numeric media IDs. They convert long 19-digit numbers into shorter, URL-friendly 11-character strings.
Shortcode vs Media ID
Shortcode
11 characters
CXhfQ9OgFjP
Used in URLs
Media ID
19 digits
2722326650967095055
Used in API
Why Instagram Uses Shortcodes
- Shorter URLs: 11 characters vs 19 digits makes URLs cleaner
- URL-friendly: No special characters that need encoding
- Easier to share: Shorter codes are easier to type and remember
- Consistent format: All shortcodes have the same length
- Maintains uniqueness: Each post has a unique shortcode
What Information Do Shortcodes Contain?
Instagram shortcodes encode the media ID, which contains:
- Timestamp: When the post was created
- Unique identifier: Distinguishes this post from all others
- Internal metadata: Instagram's internal tracking information
How to Get Instagram Shortcodes
Method 1: From Browser
- Open the Instagram post in your browser
- Look at the URL in the address bar
- Copy the code after /p/, /reel/, or /tv/
Method 2: From Mobile App
- Open the post in the Instagram app
- Tap the three dots (•••) menu
- Select "Copy Link"
- Paste to see the URL with the shortcode
Common Use Cases
- Sharing Instagram posts via URL
- Embedding Instagram posts on websites
- Tracking specific posts for analytics
- Converting between shortcodes and media IDs
- Building Instagram integration tools
- Archiving Instagram content
Shortcode Conversion
You can convert between Instagram shortcodes and numeric media IDs:
- Shortcode → Media ID: Decode using base64url decoding
- Media ID → Shortcode: Encode using base64url encoding
- Extract timestamp: Media IDs contain creation timestamps
Technical Details
Encoding: Base64url (URL-safe Base64)
Character set: A-Z, a-z, 0-9, -, _
Length: 11 characters (typically)
Format: No padding (= characters removed)