What is the GEOJSON file format?
A .geojson file contains geographical data encoded in the JSON text format. The file can store information about locations (points), lines, polygons, or other geometry types. Its contents can represent real-life objects - for example, a line can represent a road or a transmission line, while a polygon might outline a building footprint or an administrative boundary.
A .geojson document is structured around a top-level type field, most commonly "FeatureCollection", which holds an array of Feature objects. Each Feature pairs a geometry (coordinates) with a free-form properties object for attribute data such as name, population, or category. The format was first defined by a community working group in 2008 and standardized as IETF RFC 7946 in 2016, which fixed the coordinate reference system to WGS 84 and mandated longitude-before-latitude coordinate order - a common source of errors when tools assume the reverse.
.geojson files do not necessarily store only traditional map data such as country boundaries or roads. Such files are also used for abstract spatial data, for example, a GSM signal coverage map or navigational waypoints. Because the format is plain UTF-8 text built on JSON, data can easily be transferred between applications and is natively consumed by web-mapping libraries such as Leaflet, Mapbox GL, and OpenLayers. For large datasets, more compact alternatives like TopoJSON offer smaller file sizes, but .geojson remains the standard exchange format for web mapping. Related geospatial formats include .kml and .gpx.
Security & safety
RISK: LOWGeoJSON is plain JSON text with no executable code, so the file itself is safe to open in any editor. Two caveats: very large GeoJSON files can freeze a browser-based viewer (use QGIS or convert to a binary/topology format for big data), and the data can be privacy-sensitive - coordinates can reveal a home, route or asset location, so review 'properties' before sharing publicly. Watch the longitude-first ordering when feeding it to tools that expect lat,lon, or features will land in the wrong place.
Format details
in a nutshellPrograms that open GEOJSON files
ogrinfo data.geojson or convert with ogr2ogr out.shp data.geojson. The engine behind most GIS conversions. ogrinfo -al data.geojson to inspect; ogr2ogr out.gpkg data.geojson to convert. Technical details
deep spec| MIME type | application/geo+json (registered by RFC 7946); legacy: application/vnd.geo+json |
| Text encoding | UTF-8 without BOM (mandated by RFC 7946; a BOM is prohibited for interchange) |
| Base format | JSON (plain text); parseable by any standard JSON library without a dedicated GIS parser |
| Coordinate reference system | WGS 84 (EPSG:4326), fixed by RFC 7946; no alternative CRS declarations are permitted in conforming files |
| Coordinate axis order | Longitude, latitude (then optional altitude in metres); opposite to the lat,lon convention used by many GIS tools - a frequent cause of misplaced points |
| Supported geometry types | Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, GeometryCollection |
| Document structure | Top-level JSON object with a "type" member; FeatureCollection holds a "features" array of Feature objects, each with "geometry" and "properties" keys |
| File identifier | No binary magic bytes; identified by a JSON object whose top-level "type" value matches a GeoJSON type name (e.g. FeatureCollection, Point) |
| Compression | None built-in; commonly served gzip-compressed over HTTP via Content-Encoding; can reduce size 60-90% for text-heavy files |
| Typical file size | A few KB (handful of points) to hundreds of MB (high-resolution polygon boundaries); verbose compared to binary GIS formats such as FlatGeobuf |
| Pre-RFC 7946 compatibility | 2008 community-spec files may include a "crs" member and bbox at any geometry level; RFC 7946 removed CRS declarations entirely |
| Integrity / checksums | None built-in; integrity managed by transport layer (TLS) or version control (Git) |
| Line-delimited variant | GeoJSONL / NDJSON (`.geojsonl`): one GeoJSON Feature per line, enabling streaming ingestion and partial reads of large datasets |
| Web and GIS adoption | Native input format for Leaflet, Mapbox GL JS, and OpenLayers; GitHub's repository browser renders `.geojson` files as interactive maps automatically |
| Released | 2008 (community GeoJSON spec); IETF RFC 7946 published August 2016 |
| Latest version | RFC 7946 (August 2016) |
| Open standard | Yes · royalty-free |
| Specification | www.rfc-editor.org |
GEOJSON conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about GEOJSON files.
Frequently asked questions
How do I open a GeoJSON file?
What's the difference between GeoJSON and JSON?
Why are my GeoJSON points in the wrong place / in the ocean?
How do I convert GeoJSON to Shapefile?
ogr2ogr -f "ESRI Shapefile" out.shp in.geojson. Remember a Shapefile is several files (.shp/.shx/.dbf) and shortens field names.How do I convert GeoJSON to KML?
ogr2ogr -f KML out.kml in.geojson. KML lets you view the data in Google Earth or import it into Google My Maps.