GeoJSON Minifier

Strip whitespace and round coordinate precision to shrink GeoJSON files

Ad placeholder (leaderboard)

A GeoJSON minifier makes map data files smaller so they download and render faster in the browser. GeoJSON exported from GIS tools is often pretty-printed with indentation and stores coordinates with 15 decimal places of floating-point precision — far more than any web map can display. This free tool removes that overhead client-side, with no upload and no account.

How it works

Two independent transforms run on your data:

  1. Whitespace removal. The input is parsed with JSON.parse and re-serialised with JSON.stringify and no spacing argument, which collapses all indentation and newlines.
  2. Coordinate rounding. The tool recursively walks every array in the document. A coordinate pair is detected as an array whose entries are all numbers; each number is rounded to your chosen decimal precision using Math.round(n * 10^d) / 10^d. Trailing zeros are dropped automatically by JavaScript’s number-to-string conversion, which is where most of the byte savings come from.

Rounding precision maps to real-world distance at the equator like this: 4dp is roughly 11 m, 5dp roughly 1.1 m, and 6dp roughly 0.11 m. Longitude precision shrinks toward the poles, so the figures are an upper bound.

Tips and notes

  • For street-level web maps, 5 decimal places is the sweet spot — typically a 50–70% size reduction with no visible change.
  • Keep an unrounded master copy if you need survey-grade accuracy; rounding is lossy and not reversible.
  • Combining this with gzip on your server compounds the saving, because shorter, more repetitive numbers compress better.
  • The tool handles nested geometries (MultiPolygon, GeometryCollection) because it walks the whole tree rather than assuming a flat structure.
Ad placeholder (rectangle)