Skip to main content

JavaScript Source Map Decoder

Decode a .map file's Base64 VLQ mappings to find the original source, line and column behind a minified position, browse the full generated-to-original mappings table, or unmap an entire minified stack trace back to your source.

Input

Drop a file or browse
One file · text
Or

The contents of a .map file, or the JSON decoded from an inline //# sourceMappingURL= data: URI.

1-based, as shown in a code editor or browser stack trace — the first character on a line is column 1.

Output

Original position
 
Was this helpful?

Guides

When a bundler minifies your JavaScript, it produces a .map file alongside it — a JSON document that maps every position in the minified output back to a line and column in your original source. Reading that mapping by hand means decoding Base64 VLQ (Variable-Length Quantity) segments packed into the map's mappings field, which is exactly the kind of binary, algorithmic work this tool does for you.

How to use it

Paste the contents of a .map file (or upload it directly) into the source map field, then pick a mode:

  • Look up a position — enter a minified line and column (as shown in your browser's DevTools or a minified-code viewer) to get the original file, line, column and a snippet of the surrounding source.
  • Full mappings table — see every generated-to-original mapping the source map contains, one row per segment.
  • Unmap a stack trace — paste an entire minified stack trace and get back the same trace with every recognizable file:line:column rewritten to its original location.

Where to find a source map

Most bundlers (webpack, esbuild, Vite, Rollup, Terser) can emit one automatically — look for a //# sourceMappingURL= comment at the end of the minified file. If it points to a .map URL, fetch that file's contents; if it's an inline data:application/json;base64,... URI, decode the Base64 and paste the resulting JSON here.

FAQ

Why does the position lookup need 1-based line/column?

Because that's what you see everywhere else — a code editor's line/column indicator, a browser's DevTools, and a JavaScript stack trace all count both from 1. The tool converts internally to the 0-based column source maps actually use, so you never have to do that math yourself.

Does the context snippet always show up?

Only when the source map embeds the original file's content (sourcesContent). Some build tools omit it to keep the map small — without it, the tool can still report the exact original file, line and column, just without a code preview.

What if my stack trace spans multiple files?

This tool applies one pasted source map to every frame it can parse a file:line:column from — the file name itself is not matched, so it works well for a stack trace that's entirely from one bundle. For a stack trace spanning several bundled files, unmap it a few frames at a time with the source map for the file each frame actually belongs to.

My code isn't minified — I just want to read it

For unminified, already-readable code you want to reformat, use the JavaScript Code Formatter instead. To go the other direction — shrink your source into the minified file a source map decodes back from — see the JavaScript Minifier.

Privacy

Everything runs in your browser — the source map, stack trace and any file you upload never leave your device.

sourcemapvlqwebpackbabelterserminifiedstack traceunminifydebugging

More ways to use this tool

REST API

curl -X POST https://api.iotools.cloud/v1/tool/source-map-decoder \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "position",
    "sourceMapText": "{\"version\":3,\"sources\":[\"src.js\"],\"sourcesConten…",
    "minifiedLine": "1",
    "minifiedColumn": "21",
    "contextLines": "1"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `source-map-decoder` tool (JavaScript Source Map Decoder) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Embed widget

<iframe
  src="https://iotools.cloud/embed/source-map-decoder/"
  width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
  title="JavaScript Source Map Decoder — iotools.cloud"
  sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
  allow="clipboard-write"
  style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>

Drop this into your own page — free, no key required, just a link back.

Cost per callFrom 5 credits

Also available with

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.