Source Map Compressor
Upload a JavaScript or CSS source map (.map) file to compress it with GZIP and Brotli — shows exact size savings, parses source map metadata, and generates ready-to-use nginx, Apache, and CDN server configuration. Runs entirely in your browser with no signup required.
Upload a JavaScript or CSS source map (.map) file to compress it with GZIP and Brotli — shows exact size savings and generates ready-to-use nginx, Apache, and CDN server configuration snippets. Runs entirely in your browser.
Drop your source map file here
or click to browse
.map, .js.map, and .css.map files are supported
Why Use Our Source Map Compressor?
Instant Source Map Compression
Compress .map files with GZIP and Brotli instantly in your browser — see exact size savings and download the compressed files in seconds.
Secure Source Map Compressor Online
Your source map file never leaves your device. All compression runs locally in the browser sandbox — safe for source maps containing proprietary code paths.
Ready-to-Use Server Config
Get nginx, Apache, and CDN configuration snippets tailored to your source map file — copy and paste directly into your server configuration.
100% Free Forever
Compress as many source map files as you need, completely free. No account, no subscription, no file size limits, and no ads.
Common Use Cases for Source Map Compressor
Production Build Optimization
Compress source maps before deploying to production — GZIP reduces .map file sizes by 70–85%, significantly cutting CDN storage costs and bandwidth for developer tools.
Error Monitoring Integration
Compress source maps before uploading to Sentry, Datadog, or Rollbar — smaller files upload faster and reduce storage costs in your error monitoring platform.
nginx & Apache Configuration
Get ready-to-use server configuration snippets for serving pre-compressed source maps — configure gzip_static in nginx or mod_deflate in Apache with one copy-paste.
CDN & Object Storage
Upload compressed .map.gz files to S3, CloudFront, or Cloudflare R2 — serve them with the correct Content-Encoding header to reduce CDN egress costs.
Security Audit Preparation
Analyze source map metadata before deployment — check whether sourcesContent is embedded (exposing original source code) and whether the file should be restricted to internal access.
CI/CD Pipeline Integration
Add source map compression to your build pipeline — compress .map files post-build and upload both the original and .gz versions to your deployment target.
Understanding Source Map Compression
What is Source Map Compression?
Source map compression is the process of applying GZIP or Brotli compression to JavaScript and CSS source map (.map) files before serving them from your web server or CDN. Source maps are JSON files that map minified production code back to the original source — they can be very large (often 2–10× the size of the minified file itself) because they contain the full mapping data and optionally the original source code. Our free source map compressor compresses your .map files in the browser and generates the server configuration needed to serve them correctly.
How Our Source Map Compressor Works
- Upload Your Source Map: Drag and drop or click to select any .map, .js.map, or .css.map file from your device.
- Browser-Based Compression:Click "Compress Source Map" — the tool compresses the file with GZIP and Brotli using the browser's native CompressionStream API. Your source map never leaves your device.
- Download & Configure: Download the compressed .map.gz file and copy the server configuration snippet for nginx, Apache, or your CDN.
What Gets Analyzed and Compressed
- Source Map Version: The tool validates the source map version field (should be 3 for modern source maps).
- Sources Count: The number of original source files referenced in the map — more sources means a larger file.
- Mappings Size: The VLQ-encoded mappings string is the largest part of most source maps — it compresses extremely well with GZIP.
- Inline Sources Warning: If
sourcesContentis embedded, the tool warns you — this embeds the full original source code and significantly increases file size.
Why Source Maps Compress So Well
Source maps are JSON files containing highly repetitive VLQ-encoded mapping strings and file path lists. This repetitive structure is ideal for GZIP and Brotli compression — typical source maps achieve 70–85% size reduction. A 5 MB source map compresses to under 1 MB with GZIP, making it practical to serve source maps in production for error monitoring tools like Sentry and Datadog.
Related Tools
JSON Key Shortener
Shorten verbose JSON keys to single letters or abbreviated forms — shows size reduction and provides a downloadable key mapping file for restoration. Free online JSON key shortener.
JSON vs MessagePack Size Comparison
Compare JSON byte size vs MessagePack encoding for any payload — shows exact savings, type-by-type breakdown, and MessagePack hex preview. Free online JSON vs MessagePack comparison.
String Decompressor (GZIP/LZ)
Decompress GZIP+Base64, DEFLATE+Base64, and LZ-String compressed payloads back to readable text — supports all three LZ-String variants. Free online string decompressor.
ZIP File Extractor
Extract files from any ZIP archive client-side — browse contents, preview text files, download individual files or all at once. Free online ZIP extractor, no signup required.
Frequently Asked Questions About Source Map Compressor
A source map compressor applies GZIP or Brotli compression to JavaScript and CSS source map (.map) files to reduce their size before serving them from a web server or CDN. Our free online source map compressor runs entirely in your browser — no signup or server upload required.
Source maps are JSON files that can be 2–10× larger than the minified JavaScript they map. Compressing them with GZIP reduces their size by 70–85%, cutting CDN storage costs, reducing upload times to error monitoring tools like Sentry, and improving developer tools load times when debugging production errors.
Yes, complete privacy is guaranteed. All compression runs entirely client-side in your browser. Your source map file — which may contain original source code paths and structure — never leaves your device and is never uploaded to any server.
Yes. The source map compressor is 100% free with no signup, no subscription, no file size limits, and no ads. You can compress as many source map files as you need.
The sourcesContent field in a source map contains the full original source code of each referenced file. When embedded, it makes the source map much larger but allows debugging without access to the original source files. You can disable it in webpack with devtool: "source-map" (without inline) or in Vite with sourcemap: true and build.sourcemapExcludeSources: true.
Upload both the original .map file and the .map.gz file to your server. Enable gzip_static on in your nginx location block — nginx will automatically serve the .gz version when the client sends Accept-Encoding: gzip. The tool generates the exact nginx configuration snippet you need.
It depends on your security requirements. Source maps expose your original source code structure and file paths. For public-facing production sites, consider restricting .map file access to internal IPs or authenticated users only. For error monitoring, upload source maps directly to your monitoring tool (Sentry, Datadog) rather than serving them publicly.
.map.gz uses GZIP compression and is supported by all web servers and CDNs. .map.br uses Brotli compression and achieves 15–25% better compression than GZIP, but requires server-side Brotli support (nginx 1.11.6+, Apache with mod_brotli). For maximum compatibility, use GZIP; for maximum compression, use Brotli where supported.