Source Map Decoder

Decode one position in a source map mappings string. See the original file, line, and column. The source is not fetched.

Last updated: October 6, 2026

Tool

This tool will load here.

What this tool does

This source map decoder reads one source map and one generated position and prints the original position named by the mappings string. The generated line is an integer from 1 with no leading zero. Line 1 is the first group in mappings. The generated column is 0-based. The value 0 is allowed. Any other leading zero is an error. A column of 0 is the first character on that generated line.

The map must be JSON. If a sections field is present, the map is an index map and is not decoded, even if mappings is also present. If version is present, it must be the number 3. If version is absent, decoding continues and the result says the version was not declared. mappings must be a string. sources must be an array. A bad VLQ character, an unfinished VLQ group, or a segment with 2 or 3 fields fails the whole decode and clears the previous result.

Each segment has 1, 4, or 5 fields. The generated column resets at each line. The source index, original line, original column, and name index carry from one segment to the next, including across lines. The walk starts at the beginning of mappings and stops at the end of the requested line. The winning segment is the one on that line with the greatest generated column that is still less than or equal to the column you typed. A line past the end of mappings produces the message No mapping for that line. A trailing semicolon counts as an empty line. If no segment sits at or before the column, or the winning segment has only the generated column, the message is No source mapping at that column. A one-field segment does not invent a source.

A winning segment with 4 or 5 fields shows the source index, the source string unchanged, and sourceRoot or the word none. sourceRoot is not joined to the source and is not fetched. The original line is shown 0-based and again as that number plus 1, labeled as the editor line. The original column is 0-based. A fifth field shows the name when names at that index is a string. A source index or a name index that is out of range, or that became negative, fails the decode. When sourcesContent at the source index is a string, that text is shown as text. Otherwise the page says there is no embedded source. Copy writes the labeled rows and does not write the embedded source text.

How to use

  1. Paste the source map JSON.
  2. Type the generated line and the 0-based generated column.
  3. Choose Decode, or press Enter in a field. Copy writes the labeled rows. Clear empties the map, the line, the column, and the result.

Nothing is sent off the page. A source URL is text. The page does not beautify JavaScript and does not read ignore-list extension keys.

Example

The map {“version”:3,”sources”:[“a.js”],”names”:[“x”],”mappings”:”AAAAA”} at line 1 and column 0 produces source a.js, original line 0, editor line 1, original column 0, and name x. The same shape with mappings QAAA at column 0 produces No source mapping at that column, because the first segment starts at column 8. At column 8 that map produces source a.js.

A map with sections is refused as an index map. A version of 2 is refused. A map that omits version still decodes and says the version was not declared. Mappings of a single A at column 0 is a one-field segment and does not invent a source. A sourcesContent string that contains a script tag is shown as text and is not inserted as a script. A query on a line past the mappings groups says there is no mapping for that line. A mappings value that ends with a semicolon has an extra empty line.

Limits

  • Source map JSON up to 500,000 characters. Line and column fields up to 10 digits.
  • Version 3 mappings only. Index maps, bad VLQ, and 2-field or 3-field segments fail closed.
  • No fetch, no join of sourceRoot, and no beautifier.

The lookup stays in the browser. A result is the original position stored in the map for the generated position you typed. It is not the file from a server, and it is not a formatted script.

On this page

Related Articles

Related guides

Related solutions

Related Tools

Need another tool ?

Open the free tools — no signup.

FAQs

newsletter signup

Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Innovative Solutions For Modern Needs
Copyright © 2026 Yallasolve. all rights reserved.