# TopoJSON — TopoJSON (topological GeoJSON)

> TopoJSON (TopoJSON (topological GeoJSON)): GeoJSON extension that encodes vector topology as shared, quantized arcs to reduce file size for web maps. Specs, software and free sample files; convert TopoJSON to 39 formats online.

- Page: https://beta.mygeodata.cloud/formats/topojson



## What is a TopoJSON file?

TopoJSON is an extension of GeoJSON that encodes topology. Instead of storing the full coordinates of every geometry, it keeps a shared list of arcs, and each line or polygon is defined by references to those arcs, so a border shared by two neighbouring polygons is stored only once. Coordinates are usually quantized to integers and delta-encoded, with a transform of scale and translate values that restores real positions. The format was created by Mike Bostock and is published as an open specification in the TopoJSON project on GitHub.

TopoJSON is mainly used in web cartography, especially for administrative boundaries and choropleth maps rendered with D3.js, where compact files matter. A single file can contain several named objects, each holding geometries with properties. No coordinate reference system is mandated. Data are typically WGS 84 longitude/latitude, but projected coordinates are possible. Simplifying shared arcs keeps adjacent polygons free of gaps and overlaps.

TopoJSON files are usually exchanged between web developers, data journalists and cartographers who prepare boundary data for browser maps. Because geometries refer to shared arcs and coordinates are often quantized, the file cannot be read like plain GeoJSON. Check that the transform is applied, that the right named object is selected, and that simplification or quantization did not remove needed detail.

### Technical details

| | |
|---|---|
| Full name | TopoJSON (topological GeoJSON) |
| Data type | Vector · Web & JSON |
| File extension | .topojson, .json |
| Files | Single file |
| Media type | application/json |
| Geometry types | Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection |
| Multiple layers | Yes |
| Mixed geometry in a layer | Yes |
| Attribute names | — |
| Coordinate system | Any; WGS 84 (EPSG:4326) by default (not recorded in the file) |
| Converter support | Read & write |
| Typical software | Mapshaper, D3.js, GDAL/OGR, QGIS, Vega-Lite |
| Specification | https://github.com/topojson/topojson-specification |

### Specifications & references

- https://github.com/topojson/topojson-specification
- https://gdal.org/en/stable/drivers/vector/topojson.html

### Sample TopoJSON files — free download

- [Land cover (polygons)](https://beta.mygeodata.cloud/static/landing/samples/v1/topojson/st-helena-landcover.topojson) — 190 land-cover polygons (forest, scrub, farmland, residential, water, …) from OpenStreetMap with area in hectares. TopoJSON topology with quantized arcs. (81.9 kB, EPSG:4326)
- [Basemap (4 objects)](https://beta.mygeodata.cloud/static/landing/samples/v1/topojson/st-helena-basemap.topojson) — Saint Helena places, roads, waterways and land cover as four TopoJSON objects in one topology. (189.8 kB, EPSG:4326)

### Convert TopoJSON to other formats

- [TopoJSON to GeoJSON](https://beta.mygeodata.cloud/converter/topojson-to-geojson)
- [TopoJSON to SVG](https://beta.mygeodata.cloud/converter/topojson-to-svg)
- [TopoJSON to DXF](https://beta.mygeodata.cloud/converter/topojson-to-dxf)
- [TopoJSON to SHP](https://beta.mygeodata.cloud/converter/topojson-to-shp)
- [TopoJSON to GPX](https://beta.mygeodata.cloud/converter/topojson-to-gpx)
- [TopoJSON to GeoPDF](https://beta.mygeodata.cloud/converter/topojson-to-geopdf)
- [TopoJSON to KML](https://beta.mygeodata.cloud/converter/topojson-to-kml)
- [TopoJSON to CSV](https://beta.mygeodata.cloud/converter/topojson-to-csv)
- [TopoJSON to XLSX](https://beta.mygeodata.cloud/converter/topojson-to-xlsx)
- [TopoJSON to GPKG](https://beta.mygeodata.cloud/converter/topojson-to-gpkg)
- [TopoJSON to KMZ](https://beta.mygeodata.cloud/converter/topojson-to-kmz)
- [TopoJSON to MapInfo](https://beta.mygeodata.cloud/converter/topojson-to-mapinfo)
- [TopoJSON to MIF](https://beta.mygeodata.cloud/converter/topojson-to-mif)
- [TopoJSON to SQLite](https://beta.mygeodata.cloud/converter/topojson-to-sqlite)
- [TopoJSON to FGB](https://beta.mygeodata.cloud/converter/topojson-to-fgb)
- [TopoJSON to GML](https://beta.mygeodata.cloud/converter/topojson-to-gml)
- [TopoJSON to MVT](https://beta.mygeodata.cloud/converter/topojson-to-mvt)
- [TopoJSON to Parquet](https://beta.mygeodata.cloud/converter/topojson-to-parquet)

## Frequently asked questions

### How does TopoJSON differ from GeoJSON?

GeoJSON stores full coordinates for every geometry, so shared borders are duplicated. TopoJSON stores each shared border once as an arc and geometries reference those arcs, which usually makes files smaller and keeps neighbouring shapes consistent.

### Why does my TopoJSON file show coordinates that are not longitude and latitude?

Coordinates are often quantized integers that must be restored with the file's scale and translate transform. Without applying it, positions look wrong. Some files may also contain projected coordinates, as the format does not record a CRS.

### Why do I get several layers when I open a TopoJSON file?

A TopoJSON file can hold several named objects, and GIS software may list each as a separate layer. Pick the object you need, or convert each one to its own file, for example to GeoJSON or Shapefile.

### What is a TopoJSON file?

TopoJSON is an extension of GeoJSON that encodes topology. Instead of storing the full coordinates of every geometry, it keeps a shared list of arcs, and each line or polygon is defined by references to those arcs, so a border shared by two neighbouring polygons is stored only once. Coordinates are usually quantized to integers and delta-encoded, with a transform of scale and translate values that restores real positions. The format was created by Mike Bostock and is published as an open specification in the TopoJSON project on GitHub.

TopoJSON is mainly used in web cartography, especially for administrative boundaries and choropleth maps rendered with D3.js, where compact files matter. A single file can contain several named objects, each holding geometries with properties. No coordinate reference system is mandated. Data are typically WGS 84 longitude/latitude, but projected coordinates are possible. Simplifying shared arcs keeps adjacent polygons free of gaps and overlaps.

### How do I open a TopoJSON file?

TopoJSON files can be opened in Mapshaper, D3.js, GDAL/OGR, QGIS and Vega-Lite. Without any software you can preview and convert them online in MyGeodata Cloud.

### What can I convert TopoJSON to?

Popular conversions are GeoJSON, SVG, DXF, SHP, GPX and GeoPDF. In total the Converter writes TopoJSON data to 39 formats.

### How do I create a TopoJSON file?

Convert existing data to TopoJSON — for example from GeoJSON, SHP, KML, SVG and GeoPDF. Upload the file, choose TopoJSON as output and download the result.

### Which coordinate system does TopoJSON use?

TopoJSON can hold coordinates in any coordinate system, but it has no standard way to record which one. WGS 84 (EPSG:4326) is the default and is assumed when a file does not say otherwise; for any other system, tell the application that reads the file.

