devkult_
tools30converters34
home/mime/.geojson

.geojson MIME type

GeoJSONtext & code

application/geo+json

Geographic features — points, lines and polygons — as JSON, standardized by RFC 7946.

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

Good to know

  • Coordinates are [longitude, latitude], in that order. Swapping them is the classic GeoJSON bug: points land in the wrong hemisphere or in the ocean.
  • RFC 7946 fixes the coordinate system to WGS 84, so the old crs member is gone.
  • Most servers have no .geojson mapping. fetch().then((r) => r.json()) ignores the Content-Type, so map code rarely breaks — but set the type so caches and CDNs compress the file.

Serve .geojson files with the right type

The response header to send:

Content-Type: application/geo+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/geo+json geojson;
Apache (.htaccess or server config)
AddType application/geo+json .geojson
Express
res.set("Content-Type", "application/geo+json");
Python
import mimetypes

mimetypes.add_type("application/geo+json", ".geojson")
HTML file input
<input type="file" accept=".geojson,application/geo+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.geojson | grep -i '^content-type:'
file --mime-type file.geojson

Frequently asked questions

What is the MIME type for .geojson files?

application/geo+json.

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

Content-Type: application/geo+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