What is GeoJSON? Complete Guide with Examples

Learn everything about GeoJSON, the popular geographic data format that's revolutionizing web mapping and spatial data exchange.

What is GeoJSON?

GeoJSON is an open standard format designed for representing simple geographical features, along with their non-spatial attributes. Based on JavaScript Object Notation (JSON), it's become the de facto standard for web-based mapping applications and APIs.

Created in 2008 and standardized as RFC 7946 in 2016, GeoJSON provides a lightweight, human-readable way to encode geographic data structures including points, lines, polygons, and collections of these geometries.

Key Features

  • Human-readable JSON format
  • Widely supported by mapping libraries
  • Lightweight and efficient
  • Supports complex geometries and properties
  • Web-friendly and API-compatible

GeoJSON Structure

Every GeoJSON object has a type property that indicates the type of geometry or feature:

Geometry Types

  • Point: A single position
  • LineString: An array of positions forming a line
  • Polygon: An array of linear rings (closed LineStrings)
  • MultiPoint: Multiple points
  • MultiLineString: Multiple lines
  • MultiPolygon: Multiple polygons
  • GeometryCollection: Collection of geometry objects

Feature Objects

Features combine geometry with properties, allowing you to attach metadata to geographic shapes.

Examples

Simple Point

{
  "type": "Feature",
  "geometry": {
    "type": "Point",
    "coordinates": [-122.4194, 37.7749]
  },
  "properties": {
    "name": "San Francisco",
    "population": 883305
  }
}

Polygon Example

{
  "type": "Feature",
  "geometry": {
    "type": "Polygon",
    "coordinates": [[
      [-122.4, 37.8],
      [-122.4, 37.7],
      [-122.3, 37.7],
      [-122.3, 37.8],
      [-122.4, 37.8]
    ]]
  },
  "properties": {
    "name": "Sample Area"
  }
}

Common Use Cases

Web Mapping

Perfect for Leaflet, Mapbox, and other web mapping libraries

APIs

Standard format for location-based web services

Data Exchange

Lightweight format for sharing geographic data

Mobile Apps

Efficient format for mobile mapping applications

Ready to Work with GeoJSON?

Convert your geographic data to and from GeoJSON format with our free online converter.

Start Converting