Source maps map compiled, minified, or transpiled code back to its original source code, enabling debugging of TypeScript and JSX in browsers.
A Source Map is a standardized JSON metadata file that creates a bidirectional mapping between transformed, bundled, or minified production assets and their original, human-readable authoring code. Standardized in the Source Map V3 Proposal by Google and Mozilla engineers, source maps allow browser developer tools (Chrome DevTools, Safari Web Inspector, Firefox Developer Edition) to reconstruct and debug original TypeScript, JSX, Svelte, or SCSS files directly within the browser console when runtime errors occur.
Inspect dependencies, bundle bloat, and source map fidelity using our interactive Source Map Explorer or analyze compiled output with the JS Minifier.
| Specification | Details |
|---|---|
| Standard Reference | Source Map Revision 3 Proposal |
| Data Format | Standard JSON |
| Standard File Extension | .map (e.g., bundle.min.js.map) |
| Encoding Algorithm | Base64 Variable-Length Quantity (Base64 VLQ) |
| Linkage Directive | //# sourceMappingURL=bundle.min.js.map or Data URI |
| Browser Support | Chrome, Edge, Safari, Firefox (DevTools enable/disable toggle) |
{
"version": 3,
"file": "app.bundle.min.js",
"sources": [
"src/index.ts",
"src/utils/math.ts"
],
"sourcesContent": [
"import { add } from './utils/math';\nconsole.log(add(2, 3));",
"export const add = (a: number, b: number) => a + b;"
],
"names": ["add", "console", "log"],
"mappings": "AAAA,YAAY,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC;AACxB,OAAO,CAAC,GAAG..."
}
| Field | Type | Description |
|---|---|---|
version |
Integer | Source map standard version (always 3). |
file |
String | The generated/minified file name associated with this map. |
sources |
Array[String] | Relative or absolute URLs of the original source files. |
sourcesContent |
Array[String] | (Optional) Full text of original source files, enabling debugging without hosting raw source trees. |
names |
Array[String] | List of original variable, function, and identifier names modified by manglers. |
mappings |
String | Semicolon and comma-separated string of Base64 VLQ values mapping generated lines and columns to source positions. |
Storing exact line and column numbers for thousands of tokens as plain numbers would make source maps tens of megabytes in size. To compress this mapping table, the V3 specification encodes 5-tuples using Base64 VLQ and relative delta offsets:
Each segment represents:
sources array)names array)Because each value is stored as a delta relative to the previous token, numbers stay small, typically encoding into 1 to 4 characters per token.
While source maps are invaluable during local development, publishing them directly to public production servers exposes your proprietary frontend code, unpublished API routes, and architectural comments to competitors and security researchers.
next build / vite build)..map files privately to error tracking platforms like Sentry, Datadog, or Bugsnag..map files from the public web server directory before asset deployment.//# sourceMappingURL= do?This special comment placed at the very bottom of a compiled JavaScript or CSS file instructs browser DevTools where to fetch the corresponding .map file. Regular users do not download the map; the browser only requests it when DevTools is opened.
This is completely normal. Source maps contain the full unminified original source code (inside sourcesContent), character-by-character coordinate translation tables, and symbol name lists. Because users never download source maps in production, their file size does not impact page load performance.
Upload your generated .map file to our Source Map Explorer to view an interactive visual treemap of all NPM dependencies.
Free, browser-based utilities to test, generate, and inspect JavaScript Source Maps (V3 Specification) payloads directly.
Resolve minified stack traces back to original source code using source maps.
Format, minify, and validate JavaScript code instantly.
Analyze and visualize JavaScript bundle sizes with optimization suggestions.