DevTools Logo

Source Map Explorer

Source Map Explorer

Attribute bundle bytes to original modules and resolve generated line/column positions.

Runs in your browser
Try an example

Bundle & map

0 bundle chars · 0 map chars

Byte attribution

Waiting for a map

Paste a bundle and its source map

Nothing is uploaded: decoding and byte attribution happen in this tab.

Details

Paste or upload a minified bundle and its Source Map v3 file. The tool decodes Base64-VLQ mappings locally, assigns each generated byte span to its owning module, shows a size treemap and an attributed table, and resolves a pasted stack frame such as at fn (app.js:1:8) back to its original file, line and column. An optional comparison map reports per-module byte deltas, and the attribution table exports as CSV. No bundle or map is uploaded.

More examples

Three-module bundle

app.js (abc...), app.js.map with three webpack:/// sources

The treemap shows how many generated bytes belong to each module, with unmapped bytes listed separately.

Resolve a stack frame

at fn (app.js:1:8)

A binary search over the decoded segments finds the last mapping at or before column 8, returning the original file, line and column.

Compare two builds

previous app.js.map pasted into the comparison field

Per-module deltas show which modules grew or shrank between builds, sorted by absolute change.

Examples

Byte share

Input
10 generated characters, 3 mapped segments
Output
a.js 1 B · b.js 1 B · c.js 8 B

Each segment owns the span up to the next segment on its line.

Frame lookup

Input
at fn (app.js:1:8)
Output
src/c.js:1:0

The resolver selects the greatest mapped column at or before 8.

Build delta

Input
Compare with a map where c.js has no segment
Output
c.js +8 B

Deltas are computed by normalized source path across the two attributions; here the current build assigns eight more bytes to c.js.

About this tool

Source Map Explorer decodes a Source Map v3 file in your browser and uses its mappings to answer two questions: where did each generated byte come from, and where does a generated line/column point in the original source?

The byte-attribution pass follows the source-map-explorer algorithm: a mapping segment owns the generated text until the next segment on the same line. Totals are grouped by normalized source path, shown as a size treemap and an accessible table, with unmapped bytes in their own row. Pasting a previous map adds per-module byte deltas so a build-size regression is visible at a glance.

The stack-frame resolver parses forms such as at fn (app.js:1:8) and binary-searches the segments on that generated line. It returns the original source path, 1-based line, 0-based column and the original identifier when the mapping carries a name from the map's names array.

Webpack-prefixed paths are displayed without their scheme for readability while the full path stays available for matching. Maps embedded as base64 data URIs in sourceMappingURL comments are accepted as well as standalone .map files. Nothing is uploaded: all parsing and rendering happen in the tab.

What this tool does not do

  • Only Source Map v3 JSON is decoded; indexed maps and other versions are rejected with an explicit message.
  • Byte attribution is line-span based, so a segment's generated bytes are approximate ownership rather than compiler accounting.
  • The output is a byte-share table and position resolver, not a side-by-side original-source editor; sourcesContent is not displayed.
  • Very large maps are decoded on the main thread; consider filtering a chunk before pasting a multi-hundred-megabyte map.
  • The comparison map is decoded with the current bundle; mismatched bundles produce meaningless deltas.

How to use this tool

  1. Load a pair

    Paste or upload the minified bundle and its .map file, or click the three-module example chip to see the shape immediately.

  2. Read the attribution

    The treemap and table show generated bytes per original module, a share percentage and the unmapped remainder.

  3. Resolve a frame

    Paste a stack frame such as at fn (app.js:1:8) and click Resolve frame to see the original file, line and column.

  4. Compare builds

    Paste an older map into the comparison field to add a delta column sorted by absolute byte change.

  5. Export the table

    Copy the CSV or download it for a performance report; source names containing commas or quotes are escaped.

Use cases

Bundle bloat triage

Find which dependency or module contributes the most generated bytes to a chunk.

Production stack frames

Turn a minified frame into a source location without running a CLI locally.

Build regression checks

Compare two maps and see which modules grew before shipping a performance change.

Perf reports

Export an escaped CSV table of per-module byte shares for a pull request or issue.

Mapping segment fields

FieldEncoding
Generated columndelta, resets each line
Source indexdelta
Source linedelta
Source columndelta
Name indexdelta, optional

Mappings use Base64 VLQ: a continuation bit chains 5-bit groups and the low bit of the value encodes the sign.

Common mistakes

Mistake:Expecting exact source-file sizes.

Fix:Attribution counts generated bytes owned by each segment, not original file sizes; generated code can be shorter or longer than the source.

Mistake:Assuming sourcesContent is required.

Fix:Byte attribution and position lookup work from mappings alone. Content is needed only for a side-by-side source view.

Mistake:Comparing maps from different bundles without the new bundle.

Fix:Attribution needs generated text; paste the current bundle alongside both maps.

Mistake:Treating an unmapped row as a bug in the tool.

Fix:Generated code with no segments is genuinely unmapped and is reported separately.

Mistake:Reading source columns as 1-based.

Fix:Source map columns are 0-based by specification; the resolver reports line numbers as 1-based and columns as 0-based.

Frequently asked questions

How are bytes attributed to modules?

Each mapping segment in a generated line owns the characters from its own column up to the next segment's column (or the end of the line). The tool sums the byte length of those spans per normalized source path and reports unmapped spans separately. This is the same line-span approach used by the source-map-explorer CLI.

Does it need sourcesContent?

No. Byte shares and position lookups come from the mappings array alone. sourcesContent would only be needed for a side-by-side original-text view, which this tool does not provide; resolved file names still come from the sources array.

Can it resolve a stack frame?

Yes. Paste a frame such as at add (app.js:4:9105) or just app.js:4:9105. The resolver finds the last segment at or before the generated column and shows the original file, line, column and, when present, the original identifier from the map's names array.

What about multiple maps for different chunks?

Analyze one chunk at a time. An optional comparison map shows per-module deltas against the same current bundle, which is useful for build regressions. Merging several chunk maps into one treemap is not supported because byte attribution needs each chunk's generated text.

Do my files get uploaded?

No. The bundle, map and comparison map are decoded locally in the browser tab. Nothing is sent to a server, and no bundle contents are stored.

Why are webpack paths shortened?

Webpack prefixes like webpack:///./ are stripped for display so common paths line up in the table. Deltas and grouping use the normalized path; lookup results still report the original mapped path.

What happens to generated code with no mappings?

It is counted in a separate unmapped bucket with its byte count and share. This often happens with injected boilerplate, banner comments or code emitted after the mapping pass.

Can I paste a map embedded in the bundle?

Yes. If the bundle ends with a sourceMappingURL data URI containing base64 JSON, paste it into the source map field and the tool decodes the embedded map automatically.

References & standards