devkult_
tools29converters34
home/mime/.map

.map MIME type

Source maptext & code

application/json

Source maps that map minified code back to its original source in browser devtools.

MIME typeapplication/json
Extensions.map
Content-Typeapplication/json
Compress in transit?Yes — enable gzip or Brotli

Good to know

  • Browsers fetch .map files only when devtools are open, using the //# sourceMappingURL= comment or the SourceMap response header.
  • Publishing source maps exposes your original source; restrict them or upload them only to your error tracker if that matters.

Serve .map files with the right type

The response header to send:

Content-Type: application/json

Most servers pick the type from the file extension. If yours sends the wrong one, map it explicitly:

nginx (inside the types block in mime.types)
application/json map;
Apache (.htaccess or server config)
AddType application/json .map
Express
res.set("Content-Type", "application/json");
Python
import mimetypes

mimetypes.add_type("application/json", ".map")
HTML file input
<input type="file" accept=".map,application/json">

Check it

See what a server sends for a file, and what type a local file really is by its contents:

curl -sI https://example.com/file.map | grep -i '^content-type:'
file --mime-type file.map

Frequently asked questions

What is the MIME type for .map files?

application/json.

What Content-Type header should a .map file be served with?

Content-Type: application/json. It compresses well, so let the server apply gzip or Brotli.

Related types

Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options