A production JavaScript bundle is one or a few very long lines of renamed code. When the build also ships a source map (a .map file, or an inline data: URL at the end of the bundle), that map links every position in the bundle to a file, line and column of the original code. Many maps also embed the original files themselves in a field called sourcesContent.
This tool reads a source map in your browser and gives you three things: a report of what the map contains, the original source tree rebuilt from sourcesContent (browse it, preview a file, download one, or download everything as a .zip), and a lookup that turns a bundle position or a pasted stack trace into the original file, line, column and name. Nothing is uploaded.
How to use
- Get the map: the
.mapfile next to your bundle, the file named by the bundle's lastsourceMappingURLcomment, or a bundle with an inlinedata:map. - Drop the
.map, the bundle or both onto the drop zone above, or press Choose files. The report and the original source tree appear at once. - Check how many sources carry content, browse or download them as a .zip, then paste a position or a stack trace into the lookup box and press Map to original.
Real example output
We opened eventemitter3.umd.min.js.map from the eventemitter3 npm package, then pasted a stack trace that Node 22 printed when a listener threw inside the minified emit (absolute paths shortened to file names), and pressed Map to original. Layout condensed (label and value on one line, buttons left out); every value is verbatim.
Sample: dist/eventemitter3.umd.min.js and its .map (14,599 bytes) from the eventemitter3 5.0.4 npm package (MIT), fetched 2026-11-02 (www.npmjs.com/package/eventemitter3/v/5.0.4)
Overview
Source map eventemitter3.umd.min.js.map (uploaded file)
Format regular map
file eventemitter3.umd.min.js
sourceRoot —
Sources 2 sources, 2 with content, 0 without
Names 60
Mappings 654 segments on 1 generated lines
Ignore list —
Bundler hints rollup 1
node_modules 0 of 2 sources (0%)
Position lookup
c.<anonymous> throw.cjs:3:28 OTHER FILE, NOT THIS BUNDLE
c.emit eventemitter3.umd.min.js:1:1661 MAPPED
→ index.js:180:35 name call
177 | if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);
178 |
179 | switch (len) {
180 | case 1: return listeners.fn.call(listeners.context), true;
| ^
181 | case 2: return listeners.fn.call(listeners.context, a1), true;
…
Object.<anonymous> throw.cjs:4:3 OTHER FILE, NOT THIS BUNDLE
Original sources (2)
2 files with content. Paths are cleaned: no absolute paths, no "..", duplicates renamed.
index.js 8.9 KB
index.js_commonjs-entry 328 BWhat it does
Input. Drop or choose one or more files: a .map file, a .js, .mjs, .cjs or .css bundle, or both together. Files with another name are sniffed (a map starts with {). When you add a bundle, its last sourceMappingURL comment is read:
- an inline map (
//# sourceMappingURL=data:application/json;base64,...) is decoded and used, so the bundle works on its own; - an external reference (
//# sourceMappingURL=app.js.map) is shown in the report with a note to add that file to the upload. The page never loads it for you.
If you upload several maps, the one the bundle names is used (or <bundle>.map, or the first one); the others are listed in the warnings. Limits: 256 MiB for all files together, 3,000,000 mapping segments, 2,000,000 generated lines, 200,000 sources, 10,000 index-map sections nested up to 64 levels, and a two-minute time limit.
Report.
- Map fields: the format (a regular map, or an index map with
sections, which is flattened),file,sourceRoot, the number of sources and how many carrysourcesContent, the number of names, mapping segments and generated lines. - Ignore list: how many sources are in
ignoreListor the olderx_google_ignoreList(code the bundler marks as third-party or generated). Those sources are tagged in the tree and in lookups. - Bundler hints: counts of source names that look like webpack (
webpack://), Turbopack (turbopack://), Vite (/@fs/,/@vite/), Rollup (\0virtual modules,commonjsHelpers), Rolldown, esbuild (<stdin>) or Parcel (/__parcel_source_root/). These are hints from names, not proof of the bundler. - node_modules share: how many sources live under a
node_modules/folder. - Bundle: size, number of lines and what its
sourceMappingURLsays.
Original sources. Every source that has content appears in a collapsible, searchable tree. Paths are normalized: the sourceRoot is joined, URL schemes such as webpack:// and file:// are dropped, . and .. segments are resolved, and paths stay inside the tree. You can preview a file as text, download one file, or click Download all as .zip. Sources that the map names but does not carry are listed separately.
Position lookup. Paste one or more lines into the lookup box:
- a position such as
1:2446(line and column, both counted from 1, as DevTools and stack traces show them); - stack trace lines from Chrome or Node (
at explode (https://example.com/assets/app.js:1:2446)), or Firefox and Safari (explode@https://example.com/assets/app.js:1:2446).
Each result shows the original path:line:column, the original name when the map records one, and a few lines of the original code around it with the target marked. When the bundle was uploaded, the generated code around the position is shown too. Frames that name a different file are marked other file; if no frame names the uploaded bundle (for example after a rename), every frame is mapped.
How it works
Source map version 3 is defined by ECMA-426. The mappings field is a long string of Base64 VLQ numbers: ; separates generated lines, , separates segments, and each segment holds 1, 4 or 5 numbers (generated column, then source index, original line, original column and optional name index).
Before anything is decoded, the page checks the structure of the map and scans mappings once without decoding it. That pass counts segments and lines, rejects characters outside Base64, segments with 2 or 3 fields and numbers wider than 32 bits, and stops as soon as a limit is passed. Index maps are checked the same way, section by section: offsets must strictly increase, and a section that points to another map by url is refused, because the page loads nothing over the network. Then the map is decoded with @jridgewell/trace-mapping 0.3.31, and every decoded segment is checked against its own section’s sources and names.
A lookup takes the greatest generated position at or before the one you asked for, across lines, and returns every segment at that position. This rule, the preflight checks and their order follow REA, the open-source project by morluto (MIT), which traces positions through source maps in its JavaScript analysis.
The .zip is written in the page: stored entries (no compression), UTF-8 names and a CRC-32 per file. Before writing, every path is cleaned so the archive cannot write outside the folder you extract it to: no absolute paths, no .., no empty names, no characters that Windows rejects, and duplicate names (including names that differ only in letter case) get a ~2 suffix.
How your files stay private
Your files are not uploaded:
- The tool runs in a separate frame served from
rea-reverse.com. Everything described below happens inside that frame, on your device. - This page shows one ad, after the article. The ad script runs on
tools.rea-reverse.com; the frame is a different origin, so the browser does not let the ad script, or any other script on this page, read the files you drop, or the results. - The frame’s Content Security Policy blocks every request its scripts could make (
connect-src 'none', no third-party resources at all). The frame cannot open windows or navigate this page by itself; only a link you click in the report can open a page. The only things it passes to this page are its height and the analytics events below. - Parsing, decoding, lookups and the
.zipall run in a Web Worker on your device. URLs in the files, including thesourceMappingURLof a bundle and theurlof an index-map section, are never requested. - Source code, file names, paths and snippets are shown as plain text; nothing from the files is interpreted as HTML or run.
- Analytics events are coarse: success or an error code, where the map came from (
file,inlineornone), a range for the number of sources (such as11-100), a size bucket and a duration bucket. They never contain file names, source paths, positions, stack traces or code. The frame hands them to this page, which sends them. The full list is on the privacy page. - Prefer no ads and no analytics at all? Open the tool on its own page.
How to verify this yourself
- Open your browser’s developer tools on the Network tab and load this page. Requests to
rea-reverse.comare the frame: its HTML, styles, fonts and scripts, and the worker script/_astro/sourcemap-worker-*.js. Requests to Google domains are the ad on this page. - Clear the log, then analyze a map, run a lookup and download the
.zip. Typedomain:rea-reverse.comin the filter box. At most the worker script/_astro/sourcemap-worker-*.jsappears again (a fresh worker is prepared for the next run); no request carries your data. Ad requests may continue, but they come from this page and carry nothing from the frame. - Click the
js-sourcemap/document fromrea-reverse.comand open Headers: itsContent-Security-Policyhasconnect-src 'none', andframe-ancestors https://tools.rea-reverse.com. In Chrome, Application > Frames also shows the frame’s origin and policy. The worker runs underdefault-src 'none'; script-src 'self'; connect-src 'none', so the browser does not let it make any network request. - Check the isolation: in the Console, with the context set to
top, rundocument.getElementById('tool-frame').contentDocument. It returnsnull.frames[0].documentthrows aSecurityError. That is what the ad script gets too. - Or load the page, go offline (turn off Wi-Fi, or tick Offline in the Network tab) and analyze a file. It still works.
Limitations
- No map, no restoration. Without a source map the tool does not unminify, rename variables or split the bundle into modules. That needs a deobfuscator: the site’s JavaScript deobfuscator formats, renames and splits webpack and browserify bundles in the browser, and Wakaru (
unminify/unpack) does it on the command line; the bundle recovery tutorial shows how REA uses Wakaru. - Content only if the map carries it. A map built with
sourcesContentdisabled (for example webpack’snosources-source-map) gives you names and positions, but no original text. - Original text is what the bundler saw. For TypeScript, Vue or JSX the content is usually the original file, but some loaders store an intermediate, already transformed version.
- External maps are not loaded. If the bundle points to a separate
.mapfile, add that file yourself. Index maps whose sections useurlmust be merged into one file first. - Overlapping sections are rejected, as REA does, even where some other tools accept them.
- Columns. Lookups use UTF-16 columns, as JavaScript engines and the source map format do. Positions after the last mapping of a line resolve to that last mapping.
- Lookup budget. Up to 200 positions or stack lines per lookup; the rest are counted and skipped. Lines longer than 1,024 characters are ignored.
- Zip format. No ZIP64: up to 65,534 files and 4 GiB in one archive.
Compliance
Analyze bundles and maps from your own projects, from projects you are authorized to assess, or from open-source software. Respect the licenses of the code you restore, including any terms that restrict reverse engineering, and the laws that apply to you. See the disclaimer.
Command-line equivalent
Check the map's header fields with jq 1.7.1; 2 sources and 60 names, as in the report:
$ jq -c "{version, file, sources, names: (.names | length)}" eventemitter3.umd.min.js.map
{"version":3,"file":"eventemitter3.umd.min.js","sources":["../index.js?commonjs-entry","../index.js"],"names":60}throw.cjs loads the minified file, adds a listener that throws and calls emit. Node 22.22.3 prints the minified position (absolute paths shortened to file names here and below):
$ node throw.cjs
…
Error: boom
at c.<anonymous> (throw.cjs:3:28)
at c.emit (eventemitter3.umd.min.js:1:1661)
at Object.<anonymous> (throw.cjs:4:3)
…With --enable-source-maps, Node reads the same map and lands on the same original line and column as the lookup above:
$ node --enable-source-maps throw.cjs
…
Error: boom
at c.<anonymous> (throw.cjs:3:28)
at c.c.emit (index.js:180:35)
at Object.<anonymous> (throw.cjs:4:3)
…FAQ
How do I decode a minified stack trace with a source map?
Open the .map that belongs to the exact build that threw, paste the stack trace into the lookup box and press Map to original. Frames in the bundle are mapped to the original file, line, column and name; frames from other files are marked as such.
How do I get the original source code from a source map?
If the map carries sourcesContent, the original files are inside it: browse them in the tree, preview or download one, or press Download all as .zip. Files the map only names are listed under Sources without content.
Where do I find a site's source map?
Check the last line of a script for a sourceMappingURL comment, or the SourceMap HTTP response header. Only download maps from sites you are allowed to analyze.
My stack trace maps to the wrong place.
Make sure the map belongs to the exact same build as the bundle that threw, and that the column comes from the browser or runtime, not from a beautified copy of the file.
Why do some paths have ~2 in their name?
Two sources ended up at the same path after cleaning, for example webpack://app/./src/a.js and webpack:///src/a.js. The second one is renamed so both survive extraction on any system.
Can I map original positions back to the bundle?
Not in this tool. It maps generated positions to original ones, which is what you need for stack traces and for reading minified code.
Updated
Related guides
- Recover JavaScript Source from a Bundle with REA: source maps, webpack chunk recovery, Wakaru unpacking and data-flow tracing from the command line.
- ASAR unpacker and Electron IPC analyzer: Electron apps often ship
.mapfiles insideapp.asar; extract them there and open them here. - Audit Your npm Package for Source Map Leaks Before Publishing: use this tool to see what your own map would reveal, then keep maps out of the tarball and the deployment.
- Decode a Minified JavaScript Stack Trace with a Source Map: build hidden maps and decode a pasted production stack trace frame by frame.