Instagram Media ID Converter
Introduction
The Toollect Instagram Media ID Converter does one thing precisely: it converts an Instagram shortcode to its numeric media ID, and back again, in both directions and at full precision. Paste a shortcode — DIPPWkUh7Rj — and it returns the ID 3607169348072354915; paste that number and it returns the shortcode. Paste a full Instagram link instead and the converter extracts the shortcode from the URL and produces both values, plus the canonical link.
The conversion is a pure mathematics problem, not a lookup. Instagram encodes the media ID in base-64url — a compact number system — so the conversion runs instantly in your browser with no network request, no API key, and no account. The only subtlety is size: media IDs are 19-digit numbers that exceed what a normal JavaScript number can represent exactly, which is why the tool does all arithmetic with BigInt and never rounds.
The result panel shows three fields — shortcode, media ID, standard URL — each with its own copy button. Whatever you pasted, the other side of the conversion appears as you type, and the canonical instagram.com/p/{shortcode}/ URL is always generated for sharing or storage.
Use Cases
The shortcode-to-ID conversion is one of those small operations that surfaces in surprisingly different jobs.
Data analysis and API work
Instagram's internal APIs, database exports, and third-party analytics tools key media on the numeric ID, while every public link carries the shortcode. When a spreadsheet of media IDs meets a list of shared URLs, this converter is the bridge: paste the shortcode, read the ID, and match it to the export. The direction works too — an ID pulled from a download becomes a shortcode, and from the shortcode a standard URL.
Link archives and content libraries
Teams that archive posts — social media managers, researchers, journalists — need a stable key per piece of media. The shortcode is that key, and converting to the numeric ID gives a second, unambiguous identifier that survives link shorteners and URL changes. Storing both lets any future lookup start from either side.
Verifying and deduplicating media
Two shortcodes that look unrelated may point at the same post. Because the conversion is exact in both directions, decoding two shortcodes and comparing the IDs settles it: identical IDs mean identical media. The same check confirms that a reel URL, a username-prefixed link, and an instagr.am share really are the same content when they carry the same shortcode.
Developers and tool builders
Code that ingests Instagram links often needs the media ID to query other services. Pasting a URL here and copying the extracted ID is a two-second way to test an integration or audit a feed — and the canonical URL output gives a clean, uniform address for every media route, domain, and prefix a script might encounter.
How It Works
The tool runs as you type — there is no button to press. On every keystroke it classifies the input and converts:
- Classify the input — the text is matched against three patterns: a bare shortcode (
DIPPWkUh7Rj), a numeric ID (3607169348072354915), or a full Instagram URL whose route (p,reel,reels,tv) is followed by a shortcode. - Convert to the other side — a shortcode is decoded to its numeric ID; a numeric ID is encoded to its shortcode. When the input is a URL, the shortcode is extracted from the path and decoded.
- Build the canonical URL — the standard
instagram.com/p/{shortcode}/form is assembled from the shortcode in every case. - Render — the three result rows fill in, with the invalid-input message shown only when the text matches nothing.
All four steps are local string and arithmetic work. Nothing is uploaded, no request is sent, and the conversion is exact by construction: the same shortcode always yields the same ID, and that ID always re-encodes to the original shortcode.
What counts as a recognizable URL is broader than it looks — three hosts, optional subdomains, username prefixes, and embed aliases all reduce to the same shortcode. The complete contract is in Supported URL Formats below.
Supported URL Formats
The converter recognizes every URL shape that carries a media shortcode. The grammar is deliberately wider than instagram.com/p/…: Instagram distributes the same media across several hosts and path forms, and all of them convert identically.
Accepted formats
| Format | Example | Detected as |
|---|---|---|
| Bare shortcode | DIPPWkUh7Rj |
Shortcode |
| Numeric media ID | 3607169348072354915 |
Media ID |
| Post | instagram.com/p/DIPPWkUh7Rj/ |
URL → shortcode |
| Reel | instagram.com/reel/DIPPWkUh7Rj/ |
URL → shortcode |
| Reels display | instagram.com/reels/DIPPWkUh7Rj/ |
URL → shortcode |
| IGTV | instagram.com/tv/DIPPWkUh7Rj/ |
URL → shortcode |
| Embed alias | instagram.com/p/DIPPWkUh7Rj/embed/captioned/ |
URL → shortcode |
| Username-prefixed | instagram.com/some_user.123/p/DS7w7fokujz/ |
URL → shortcode |
| Short domain | instagr.am/p/DIPPWkUh7Rj/ |
URL → shortcode |
| Direct-link domain | ig.me/reel/C0HpSipMp_k/ |
URL → shortcode |
Every media route works on every host: p, reel, reels, and tv are all recognized on instagram.com, instagr.am, and ig.me, and a username prefix is accepted on any of them — instagr.am/some_user.123/tv/C0HpSipMp_k/embed/ is just as valid as the bare canonical form. The https:// prefix, a www or m subdomain, and a trailing slash are all optional. Whatever the shape, the shortcode is extracted and the other two results — ID and canonical URL — are always the same.
Rejected formats
The other side of the contract is what the converter refuses, and why:
| URL | Why it is rejected |
|---|---|
instagram.com/some_user.123/ |
A profile — no shortcode |
instagram.com/explore/tags/photography/ |
A hashtag page — no shortcode |
instagram.com/stories/some_user/1234567/ |
A story — no shortcode |
ig.me/m/414231852796565/ |
A DM thread — a thread ID, not media |
ig.me/u/some_user.123/ |
A profile short link — no shortcode |
l.instagram.com/?u=…&e=… |
A share wrapper — the target is hidden in a parameter |
The rule of thumb is short: if the path ends in a shortcode after a media route, it converts; anything else — profile, tag, story, thread, wrapper — shows the invalid-input message. Those links are not bugs in the converter; they simply have no shortcode for a base-64 conversion to work on. The Instagram URL parser exists for exactly that range of addresses.
How the Encoding Works
The shortcode is a number written in a different numeral system. Understanding that system explains why the conversion is exact, why the alphabet is what it is, and why BigInt is not optional.
The alphabet
Instagram writes numbers in base 64, using this alphabet in this order:
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_
That is the base64url alphabet — the familiar A–Z, a–z, 0–9 of base 64 with the URL-hostile characters + and / replaced by - and _. It has exactly 64 characters, one per digit value, and no character needs escaping in a URL. Position zero is A; position 63 is _.
The arithmetic
Reading a shortcode left to right is reading a base-64 number:
DIPPWkUh7Rj = 3×64^10 + 8×64^9 + 15×64^8 + 15×64^7 + 22×64^6 + ... + 35×64^0
= 3607169348072354915
Each character contributes its alphabet position multiplied by 64 raised to its place power. Going the other way, the ID is repeatedly divided by 64 and each remainder becomes a digit from the right:
3607169348072354915 / 64 → remainder 35 → 'j' (last digit)
…and so on up the places, ending at 3 → 'D'
Because base-64 conversion is bijective — every integer has exactly one representation and every representation decodes to exactly one integer — the round trip is guaranteed: DIPPWkUh7Rj always decodes to 3607169348072354915, and that ID always re-encodes to DIPPWkUh7Rj. No lookup table, no API, no ambiguity.
Why eleven characters
Eleven base-64 digits can hold values up to 64^11 ≈ 2^66. Real media IDs sit around 2^62, comfortably inside the range with room to spare — which is why shortcodes are 10 to 12 characters long, with 11 the standard today.
Why BigInt
The arithmetic needs numbers that JavaScript's ordinary number type cannot hold. The safe integer limit is 9,007,199,254,740,991 — about 9×10^15 — while real media IDs run near 4×10^18, over 400 times larger. A plain number would round the last digits: 3799845905265518835 becomes 3799845905265518600, and the rounded value re-encodes to the wrong shortcode entirely. The converter uses BigInt for every multiplication, division, and remainder, so no digit is ever approximated.
A worked example
Take the reel URL instagram.com/reel/C0HpSipMp_k/:
- The route
reelconfirms media; the shortcodeC0HpSipMp_kis extracted. - Each character maps to its position:
C→ 2,0→ 52,H→ 7,p→ 41, and so on. - The positions are folded into a base-64 integer with BigInt:
3244743650599673828. - The standard URL
instagram.com/p/C0HpSipMp_k/is assembled. - Paste
3244743650599673828back in and the conversion runs in reverse: the ID divides out to exactlyC0HpSipMp_k.
Usage
The converter works with no buttons — the results update on every keystroke:
- Paste or type your input — a shortcode, a numeric media ID, or an Instagram post, reel, or IGTV URL from any of the three hosts, with or without a username prefix.
- Read the result panel — the shortcode row and the media ID row always show both sides of the conversion, whatever you entered.
- Check the standard URL — the canonical
instagram.com/p/{shortcode}/form is generated automatically. - Copy what you need — each row has its own copy button: copy the shortcode, the media ID, or the URL.
There is no submission, no waiting, and no error state for valid input — only text that matches none of the three formats shows the invalid-input message, which clears as soon as the input becomes valid again.
Tutorial
Walk one conversion end to end.
Step 1 — Convert a shortcode to an ID. Paste DS7w7fokujz into the input. The media ID row fills with 3799845905265518835, the standard URL row shows https://www.instagram.com/p/DS7w7fokujz/, and the copy buttons beside each row light up. Click the media ID copy button — the 19-digit number is on your clipboard.
Step 2 — Convert the ID back. Clear the input and paste 3799845905265518835. The shortcode row now shows DS7w7fokujz, and the URL row shows the same canonical link as before — proof that the conversion is an exact round trip, not a lookup.
Step 3 — Convert from a URL. Paste a full link from the app: https://www.instagram.com/reel/C0HpSipMp_k/?igsh=cXdlbg%3D%3D. The converter ignores everything except the media route and the shortcode: the media ID row reads 3244743650599673828 and the URL row reads https://www.instagram.com/p/C0HpSipMp_k/. The tracking parameter does not matter — the tool needs only the path.
Step 4 — Match an ID to a database export. Open a spreadsheet of media IDs from an API export and search for 3244743650599673828; the reel you pasted is the same media as the record in your data. From the other direction, find an ID in the export, paste it here, and the shortcode + canonical URL let you open that exact media in a browser.
Step 5 — Verify across routes, prefixes, and domains. Paste https://www.instagram.com/p/DIPPWkUh7Rj/, then https://www.instagram.com/reel/DIPPWkUh7Rj/, then https://instagr.am/p/DIPPWkUh7Rj/, and finally the username-prefixed https://www.instagram.com/some_user.123/p/DIPPWkUh7Rj/. All four decode to the same ID 3607169348072354915 — same media, four addresses, one canonical URL.
Pro Tips
- Keep the media ID as a stable key. Shortcodes are the public face of a media item; the numeric ID is its identity in every API and database. Storing the ID alongside the URL means future lookups never depend on how the link was shared.
- Round-trip to check your data. If an export's ID and a URL's shortcode disagree, decode the shortcode and compare — the conversion is exact, so a mismatch means the media really is different.
- Convert from either side of a URL. Post, reel, reels display, and IGTV routes all carry the same shortcode behind different verbs. Whatever flavour you received, the resulting ID and canonical URL are identical.
- Any domain, same media. An instagr.am link, an ig.me link, and an instagram.com link decode to the same ID when they share a shortcode, and a username prefix changes nothing either. Do not let the address's clothing make one post look like several during a dedupe pass.
- Use the standard URL for sharing. The
/p/form renders any media — post, reel, or IGTV — so the URL output is the safest address to forward, embed, or log. - The converter is a batch of one. The conversion is instant and local, so working through a list of shortcodes or IDs is a series of fast paste-and-copy cycles — no loading, no rate limits, no waiting between entries.
- Pair with the Instagram URL parser. Paste the same link into the parser for the full breakdown — type, username, detail, and cleaned URL — and use this converter whenever you need the ID from a specific shortcode on its own.
Alternatives
How else can you move between shortcodes and media IDs? The options in practice:
| Method | Both directions | Full precision | Accepts URLs | Uploads your data |
|---|---|---|---|---|
| Manual base-64 decoding | No (error-prone) | No | No | No |
| Browser console snippet | Yes, if you write it | Depends | No | No |
| Generic base64 converter | No — wrong alphabet | No | No | Yes |
| Other online converters | Sometimes | Inconsistent | Sometimes | Yes, often |
| This tool | Yes, guaranteed | Yes, BigInt | Yes | No |
Manual decoding is a calculator exercise in powers of 64 — the alphabet positions, the multiplications, the division chains — and one misplaced digit invalidates the whole result. A browser console snippet can work, but you are writing the base-64 loop yourself each time. A generic base64 converter is actively misleading: standard base64 decodes bytes with a different alphabet and padding rules, and its output has nothing to do with Instagram's media ID. Other shortcode converters vary in precision — many clamp IDs to floating-point numbers and produce subtly wrong shortcodes. This tool is the only row that guarantees the exact round trip in both directions, from shortcodes, IDs, or full URLs, with nothing leaving your browser.
Against the Official APIs
The conversion is deliberately offline, and it is worth stating what the network-based alternatives can and cannot add:
| Capability | oEmbed | Graph API | This tool |
|---|---|---|---|
| Shortcode → media ID | No | Indirect | Yes, exact |
| Media ID → shortcode | No | No | Yes, exact |
| Canonical URL from either | No | Indirect | Yes |
| Caption, owner, view counts | Yes | Yes | Not available |
| Verify the media still exists | Partial | Yes | Not available |
| API key / login | Token | Yes | None — zero requests |
oEmbed answers what is this media called — a title, author, and thumbnail in one token-authenticated call. The Graph API answers everything about the media, at the price of a token, a login, and a quota. Neither converts a shortcode to its numeric ID directly; the Graph API's node IDs are separate from media IDs, and extracting the media ID usually means taking the URL apart yourself — which is precisely the step this tool automates. The three serve different questions: for the numeric identity of a piece of media, the local converter is complete; for everything else, the APIs remain separate services.
Converter vs. URL Parser
Toollect ships two Instagram tools that both take a link and both know about shortcodes. They are complementary, not competing — the table shows which answers each one gives:
| Question | Instagram URL parser | This converter |
|---|---|---|
| What kind of link is this? | Every type — post, reel, profile, story, tag, DM, redirect | Only: does it carry a media shortcode? |
| Give me the media ID | Yes, for media links | Yes, for media links — this is its whole job |
| Clean tracking parameters | Yes — igsh, utm_*, wrapper fingerprints | Not needed — output is always a fresh canonical URL |
| Unwrap l.instagram.com wrappers | Yes, including external targets | No — rejected |
| Profile, tag, story, DM links | Parsed with type and detail | Rejected as invalid |
| Bare shortcode or numeric ID | Shortcode only | Both, in both directions |
The parser is the generalist: it tells you everything about a link, cleans it, and unwraps share wrappers. The converter is the specialist: it turns a shortcode into an ID and back, from either side, and accepts the full URL grammar as a convenience. Run the same media link through both and the ID agrees; run a bio link through both and the parser unwraps it while the converter politely declines. When a workflow needs both answers, the pairing takes two seconds — and both tools are 100% client-side with zero requests.
What It Doesn't Do
The limits are worth naming so the converter is never over-trusted:
- It does not fetch the media. No requests at all — the conversion is base-64 arithmetic in your browser, and the tool cannot tell whether a post is live, removed, or never existed.
- It does not resolve usernames or profiles. Profile links carry no shortcode, so they are outside the tool's scope and show the invalid-input message.
- It does not unwrap share wrappers. An
l.instagram.com/?u=…&e=…bio link hides its target in a URL-encoded parameter, so the path carries no shortcode and the link is rejected. Unwrapping it is the URL parser's job. - It does not handle DM or profile short links.
ig.me/m/{id}is a message thread andig.me/u/{username}is a profile — neither is media, so neither converts. - It does not expose the video or image. The standard URL it produces is an address, not content — opening it is a browser job.
- It does not guess. An input that matches none of the three formats (shortcode, ID, or media URL) produces the invalid-input message rather than a partial or approximate result.
Everything the converter claims — exact two-way conversion, URL extraction, canonical output — is guaranteed by the arithmetic itself, and everything else is deliberately left to other tools.
Troubleshooting
| Problem | Cause | Solution |
|---|---|---|
| Nothing appears in the result panel | The text is not a shortcode, ID, or media URL | Paste a bare 11-character shortcode, a numeric ID, or a link from a media route (p, reel, reels, tv) on any of the three hosts |
| A profile or hashtag link shows the error | Those routes carry no shortcode | The converter handles media only; use the Instagram URL parser for profiles and tags |
| A bio link (l.instagram.com/…) shows the error | Share wrappers hide the target in a parameter — no shortcode in the path | Unwrap it with the Instagram URL parser, which resolves the encoded target |
| An ig.me/u/… or ig.me/m/… link shows the error | Those short links are a profile and a DM thread — not media | No conversion applies; profiles and threads have no shortcode |
| The pasted ID returns a different-looking shortcode | The ID is genuinely different media | The conversion is exact — differing IDs always encode to differing shortcodes |
| The URL row differs from what I pasted | The tool normalises to the canonical /p/ form | That is by design: /p/ renders post, reel, and IGTV alike |
| I expected the ID to start with a particular digit | Nothing wrong — IDs have no fixed length | Base-64 values simply represent their number; the shortcode length is what varies, from 10 to 12 characters |
Privacy & Data Handling
This converter operates under the strictest privacy model of the Toollect tools: it makes no network requests at all.
- Nothing is uploaded. The conversion runs entirely in your browser. No request containing the shortcode, ID, or URL you pasted is ever sent anywhere.
- No account, no analytics. There is no login, no tracking script, and no record of the media you convert.
- Nothing is stored. The tool keeps no state between visits; close the tab and the conversion is gone.
- No third-party scripts. The page runs only its own code — no embed widgets, no share buttons, no external calls.
For any workflow that starts with a link or ID you would rather not send to a server, this is the page where the conversion happens without leaving your device.
Technical Specs
Details:
- Conversion: base-64url arithmetic over the Instagram alphabet (
A–Z a–z 0–9 - _), bijective in both directions with no approximation - Precision:
BigIntarithmetic for every operation; exact for IDs beyond the JavaScript safe integer range (9,007,199,254,740,991) - Input formats: bare 10–12 character shortcode (
DIPPWkUh7Rj), numeric media ID (3607169348072354915), or Instagram URL from thep,reel,reels, andtvmedia routes oninstagram.com,instagr.am, orig.me— with optional protocol, subdomain (www,m), username prefix, and embed alias; all other routes and hosts are rejected - Output: shortcode, numeric media ID, and canonical
https://www.instagram.com/p/{shortcode}/URL, each with an individual copy button - Processing: 100% client-side JavaScript, zero network requests, no API key, no server
- Browser support: all modern browsers (BigInt, clipboard API)
Features
- Converts Instagram shortcodes to numeric media IDs in both directions
- Accepts a bare shortcode, a numeric ID, or a full post, reel, and IGTV URL from instagram.com, instagr.am, or ig.me
- Decodes IDs beyond JavaScript's safe integer range with full BigInt precision
- Generates the canonical instagram.com/p/... URL from either input
- One-click copy for the shortcode, the media ID, and the standard URL
- Instant local conversion with zero network requests and no API key
- Distinguishes all four media routes — post, reel, reels, and IGTV