TopoJSON 📊

TopoJSON (Topology-Aware JSON)

Open Beta
.topojson · application/json

TopoJSON is a topology-aware extension of GeoJSON. Uses shared-arc encoding (boundaries between polygons stored only once) and integer quantization of coordinates — the resulting file is 60-80% smaller than equivalent GeoJSON. Standard input for D3.js, Mapshaper, and Observable; ideal for interactive choropleth maps and web atlases.

Export TopoJSON now ✨ Open Beta — free, no limits

Key Features

Shared-arc encoding (60-80% smaller than GeoJSON)
Integer quantization of coordinates
Topology-preserving simplification
Feature properties preserved

About TopoJSON Format

TopoJSON was invented by Mike Bostock, the author of D3.js, to solve a simple problem: in GeoJSON neighboring polygons store their shared border twice. TopoJSON moves all the lines into a common array of arcs that the objects then refer to. On top of that, coordinates are rounded to an integer grid and written as increments — the file gets sharply lighter.

The format is taken for web graphics and analytics: choropleths in D3, interactive atlases, boundary maps in Observable, lightweight layers for offline applications. The second motive is simplification: during generalization the shared borders move together, and no gaps appear between neighboring districts.

The output is a single document: every layer becomes a separate object inside it — roads, buildings, water and so on — and object attributes are preserved. Coordinates are in WGS84, up to 100,000 objects per layer. The topology is built by our own code, with no external dependencies.

The price of compactness is the rounding of coordinates. The grid step depends on the size of the area: for a district it is on the order of a meter, for a country hundreds of meters. For a web map that is invisible; for precise measurements take GeoJSON or GeoPackage.

What Program Opens TopoJSON Files

The following programs and applications can open, edit, and work with TopoJSON (Topology-Aware JSON) (.topojson) files exported from OSM2CDR:

💻D3.js 💻Mapshaper 💻topojson-server 💻topojson-client 💻Observable 💻ndjson-cli

Format specifications

Who Uses TopoJSON Maps

🏗
Interactive choropleth maps in D3.js
A choropleth in D3.js draws fast: shared district borders are stored and rendered once.
💻
Web atlases and map-driven publications
A web atlas and cartographic publications where page weight matters.
📊
Lightweight admin-boundary maps
Administrative boundary layers that can be simplified without gaps between neighbors.
🎨
Offline web applications (PWA)
An offline application or a PWA: the map takes several times less space than in GeoJSON.
🗺
Analytics and visualisation (Observable)
Exploratory analysis in Observable and notebooks — the data loads as a single small file.

How to Export TopoJSON

1
Select area
Draw a rectangle or polygon on the interactive map at osm2cdr
2
Choose TopoJSON
Select TopoJSON (Topology-Aware JSON) from the list of 127 available export formats
3
Export
Click Export and receive your .topojson file in 1-5 minutes
4
Download
Download the ready TopoJSON file and open it in D3.js

How to Open After Export

Popular maps in TopoJSON

Free

Get TopoJSON (Topology-Aware JSON) map exports

Download professional TopoJSON maps from OpenStreetMap. Instant generation, any area.

Free / export
Export TopoJSON now →

Frequently Asked Questions

How does TopoJSON differ from GeoJSON?
Can I convert TopoJSON back to GeoJSON?
Why does D3.js prefer TopoJSON?
Does TopoJSON support 3D?
How are the layers arranged inside the file?
What is quantization and what does it affect?

Related Formats

Frequently Exported Together

Related Articles