Skip to content
Aback Tools Logo

TopoJSON Compressor

Compress TopoJSON files by reducing coordinate decimal precision — see file size at 6 precision levels from 1 to 6 decimal places and choose the optimal size vs accuracy tradeoff for your use case. Optionally remove null properties for additional savings. All compression runs in your browser using pure JavaScript. No signup required.

TopoJSON Compressor

Compress TopoJSON files by reducing coordinate decimal precision — see file size at 6 precision levels from 1 to 6 decimal places. Optionally remove null properties. All compression runs locally in your browser. Your TopoJSON never leaves your device.

2.54 KB

Compression Options

Null properties add bytes without contributing data. Removing them is safe for most use cases.

Why Use Our TopoJSON Compressor?

Instant TopoJSON Compression

Compress TopoJSON files instantly in your browser — no server upload, no external libraries. Our topojson compressor reduces coordinate precision across 6 levels and shows the exact file size at each level.

Secure TopoJSON Compressor Online

Your TopoJSON file never leaves your device when you use this topojson compressor. 100% client-side processing means complete privacy — no cloud storage, no server logs, no geographic data exposure.

TopoJSON Compressor — No Installation

Compress TopoJSON files directly in your browser with no npm packages, no Node.js, and no account required. This free topojson compressor works on any modern browser on any operating system.

Precision vs. Size Tradeoff Visualization

See file size at all 6 precision levels (1–6 decimal places) simultaneously — choose the optimal tradeoff for your use case. The topojson compressor also removes null properties to save additional bytes.

Common Use Cases for TopoJSON Compressor

Web Map Tile Optimization

Use the topojson compressor to reduce TopoJSON file sizes for web map tiles. At 4 decimal places (~11 m accuracy), most country and region boundaries look identical at typical web map zoom levels while being significantly smaller.

Dashboard & Data Visualization

Use the topojson compressor to optimize TopoJSON files for D3.js and Observable dashboards. Smaller TopoJSON files load faster and reduce the time-to-first-render for choropleth maps and geographic visualizations.

CDN & Bandwidth Cost Reduction

Use the topojson compressor to reduce CDN egress costs for geographic data. A world countries TopoJSON at 3 decimal places is typically 60–70% smaller than the original — significant savings at scale.

Mobile Map Performance

Use the topojson compressor to optimize TopoJSON for mobile map applications. Smaller files reduce mobile data usage and improve map load times on slower connections — critical for global user bases.

Static Site Map Assets

Use the topojson compressor to pre-compress TopoJSON files for static site generators. Compress once at build time and serve the optimized file — no runtime processing required.

API Response Optimization

Use the topojson compressor to reduce the size of TopoJSON served from geographic APIs. Combine coordinate precision reduction with server-side GZIP for maximum wire-size reduction.

Understanding TopoJSON Compression

What is TopoJSON Compression?

TopoJSON compression is the process of reducing the file size of a TopoJSON topology file by reducing coordinate decimal precision and removing unnecessary data. TopoJSON is a compact extension of GeoJSON that encodes geographic topology — shared boundaries between polygons are stored only once, making it significantly smaller than GeoJSON for the same data. Our topojson compressor further reduces file size by rounding coordinate values to fewer decimal places (e.g., 10.123456 → 10.1235 at 4 decimal places) and optionally removing null properties from geometry objects. All compression runs entirely in your browser — no server upload required.

How Our TopoJSON Compressor Works

  1. 1Upload or paste your TopoJSON: Drag and drop a .topojson or .json file, or paste the TopoJSON content directly. The topojson compressor validates that the root object has type: "Topology" before processing. No data is sent to any server.
  2. 2Instant browser-based compression:Click "Compress TopoJSON" and the topojson compressor calculates the file size at all 6 precision levels simultaneously. Select the precision level that best fits your accuracy requirements.
  3. 3Download the compressed TopoJSON: Select your preferred precision level and download the compressed file. Copy the output directly or download as a .topojson file.

What the TopoJSON Compressor Reduces

  • Coordinate Precision: The primary compression lever. Reducing from 6 to 4 decimal places typically saves 15–30% of file size with negligible visual impact at most map zoom levels. 1 decimal place = ~11 km accuracy; 6 decimal places = ~11 cm accuracy.
  • Null Properties: Geometry objects often contain null property values that add bytes without contributing data. The topojson compressor optionally removes all null and undefined property values from geometry objects.
  • Whitespace: The topojson compressor outputs minified JSON (no whitespace or newlines) — formatted TopoJSON files can be 30–50% larger than their minified equivalent.
  • Transform Scale Precision: The transform.scale and transform.translate values are also rounded to the selected precision level, reducing the size of the topology header.

Choosing the Right Precision Level

The right precision level depends on your map's zoom level and use case. For world maps displayed at country level, 2–3 decimal places is usually sufficient. For regional maps at state/province level, 4 decimal places provides good accuracy. For city-level maps or street-level data, use 5–6 decimal places. The topojson compressor shows the file size at all levels simultaneously so you can make an informed tradeoff between file size and geographic accuracy.

Frequently Asked Questions About TopoJSON Compressor

A topojson compressor reduces the file size of a TopoJSON topology file by reducing coordinate decimal precision and removing unnecessary data. Our free topojson compressor works entirely in your browser — your TopoJSON file never leaves your device.

GeoJSON stores each geometry independently, so shared boundaries between polygons are duplicated. TopoJSON encodes topology — shared boundaries are stored only once as arcs, making it significantly smaller than GeoJSON for the same data. The topojson compressor further reduces TopoJSON file size through coordinate precision reduction.

Absolutely. The topojson compressor processes everything locally in your browser. Your TopoJSON file is never uploaded to any server, never stored, and never leaves your device — completely safe for proprietary geographic data.

Yes — 100% free, forever. No signup, no account, no premium tier, no file size limits, and no ads interrupting your workflow.

For world maps at country level, 2–3 decimal places is usually sufficient. For regional maps at state/province level, 4 decimal places provides good accuracy (~11 m). For city-level maps, use 5–6 decimal places. The topojson compressor shows file size at all 6 levels so you can choose the optimal tradeoff.

Reducing coordinate precision can cause very small gaps or overlaps at shared boundaries in extreme cases. For most web mapping use cases at 3–5 decimal places, the topology remains visually correct. Always test the compressed output in your map renderer before deploying.

Null properties in geometry objects add bytes without contributing data. The topojson compressor optionally removes all null and undefined property values from geometry objects. This is safe for most use cases — null properties are typically placeholder fields that are not used in rendering.

Typical savings depend on the original precision and file content. Reducing from 6 to 4 decimal places typically saves 15–30%. Reducing to 2 decimal places can save 40–60%. Combined with server-side GZIP compression, total wire-size reduction of 70–85% is achievable.

The topojson compressor validates that the input has "type": "Topology" — it is specifically designed for TopoJSON. For GeoJSON compression, use the GeoJSON Compressor tool which handles GeoJSON-specific optimizations.