GeoJSON is an open standard format for representing simple geographic features and their non-spatial attributes. It is based on the JSON (JavaScript Object Notation) format, which makes it human-readable, easy to parse in virtually every programming language, and natively supported by web browsers. The specification, formalized as RFC 7946, defines how to encode points, lines, polygons, and collections of these geometries alongside custom property data.
Core Structure of GeoJSON
A GeoJSON file is structured around three core objects. A Geometry describes a spatial shape — a Point with longitude and latitude, a LineString connecting ordered coordinates, or a Polygon defined by a closed ring. A Feature wraps a Geometry with an arbitrary "properties" object where you can store metadata such as names, population counts, or category labels. A FeatureCollection groups multiple Features into a single file, which is the most common top-level structure you will encounter.
Geometry Types
- Point — A single position (e.g., a city marker)
- LineString — An ordered array of positions forming a line (e.g., a road)
- Polygon — A closed ring of positions forming an area (e.g., a park boundary)
- MultiPoint — Multiple points in one feature
- MultiLineString — Multiple lines in one feature
- MultiPolygon — Multiple polygons in one feature
- GeometryCollection — A collection of mixed geometry types
Coordinate Reference System
GeoJSON uses the WGS 84 coordinate reference system (EPSG:4326) by default, with coordinates expressed as [longitude, latitude]. This convention differs from many everyday mapping tools that list latitude first, so it is worth double-checking coordinate order when creating files manually. Optional altitude values can be appended as a third coordinate element.
Example GeoJSON
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [-73.9857, 40.7484]
},
"properties": {
"name": "Empire State Building",
"height_m": 443
}
}
]
}
Tools and Libraries That Support GeoJSON
Because of its simplicity and broad tooling support, GeoJSON has become the de facto interchange format for web mapping. Libraries like Leaflet, Mapbox GL JS, D3.js, and Turf.js consume GeoJSON directly. Databases such as PostGIS and MongoDB support GeoJSON geometry natively. When you need to visualize or convert GeoJSON files without writing code, browser-based tools like GeoDataTools let you drag and drop a file, explore the data on an interactive map, filter features, and export to other formats like KML.
FAQ
What is the file extension for GeoJSON?
GeoJSON files typically use the .geojson extension, though .json is also accepted. The official MIME type is application/geo+json.
Can GeoJSON store attribute data?
Yes. Each Feature includes a "properties" object that can contain any valid JSON key-value pairs — strings, numbers, booleans, arrays, or nested objects.
Is GeoJSON suitable for large datasets?
GeoJSON works well for small to medium datasets (up to a few megabytes). For very large datasets, consider formats like GeoPackage or FlatGeobuf that support streaming and indexing.