.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.

What opens 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.

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

Open a .geojson file step by step

  1. Confirm the file really is a .geojson. Drop it into the WhatFileType identifier, which reads its signature in your browser without uploading anything.
  2. On Windows, open it with QGIS or VS Code.
  3. On Mac, use QGIS or VS Code.
  4. On Linux, try QGIS or VS Code.
  5. Still stuck? Convert the .geojson to KML, which opens more widely.

Why can't I open my .geojson file?

Almost always because no installed app understands GeoJSON. Install one of the apps above, or convert the file to a format your existing software already reads. If double-clicking opens the wrong program instead of nothing at all, the file association is set to the wrong app rather than the file being broken.

The other possibility is that the file is not really a .geojson at all. Drop it into the file identifier to check it by its bytes instead of its name. Nothing is uploaded.

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.

What is the .geojson file signature (magic bytes)?

A .geojson file starts with the hex bytes 7B, which read as { in ASCII. Programs identify GeoJSON by those bytes, not by the filename, so a renamed file still gives itself away.

These are the documented signatures for GeoJSON.

Documented magic-byte signatures for the .geojson format
Hex signatureOffsetASCIINote
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. How sources are ranked and what is deliberately left out is set out in the methodology.