.geojson

What is a .geojson file?

Geographic JSON · Data · IETF (RFC 7946) · 2016

GeoJSON is a JSON format for geographic data: points, lines and polygons with their coordinates and properties. It is the standard way to move map features between web maps, GIS tools and APIs.

Category
Data
Type
Plain text
Is a .geojson file safe to open? Safe. GeoJSON is map data in plain text. It does not execute; a mapping tool simply draws its features.

What is a .geojson file used for?

A GeoJSON file is ordinary JSON with a defined structure of Features, each holding a geometry (such as a Point or Polygon) and a bag of properties. Coordinates are longitude then latitude, in the WGS 84 system used by GPS.

Because it is plain JSON, it works directly in web mapping libraries like Leaflet and Mapbox, and opens in any text editor. Large datasets are sometimes stored as newline-delimited GeoJSON for streaming.

How to open a .geojson file

The .geojson format opens in the following apps, grouped by operating system. If one app does not work, try another from the same list. For a step-by-step walkthrough, see how to open a .geojson file.

Windows

  • QGIS
  • VS Code
  • geojson.io (web)

macOS

  • QGIS
  • VS Code
  • geojson.io (web)

Linux

  • QGIS
  • VS Code
  • geojson.io (web)

Web

  • geojson.io
  • Mapbox, Leaflet

How to convert a .geojson file

You can convert a .geojson file to KML, GPX, Shapefile using a conversion tool or the export menu of an app that opens it.

.geojson file signature (magic bytes)

Programs recognise a .geojson file by the bytes at the start of the file, not by its name. These are the signatures for GeoJSON.

Hex signatureOffsetNote
7B0'{' JSON object

See the full magic-numbers reference for every format.

Frequently asked questions

What is a .geojson file?

GeoJSON is a JSON format for geographic data: points, lines and polygons with their coordinates and properties. It is the standard way to move map features between web maps, GIS tools and APIs.

How do I view a GeoJSON file on a map?

Paste it into geojson.io, or open it in QGIS. Both render the points and shapes instantly; a text editor shows the raw coordinates.

What coordinate order does GeoJSON use?

Longitude first, then latitude, in WGS 84. This trips people up because everyday speech says latitude first.

What is the difference between GeoJSON and KML?

Both describe map features. GeoJSON is JSON and dominates web maps and APIs; KML is XML and is tied to Google Earth and Maps.

Comparisons

Related formats

Sources

Details on this page were checked against authoritative references: