← Back to Blog

How to Simplify GeoJSON Files to Reduce File Size

Learn how to simplify GeoJSON geometry to reduce file size without losing detail. Smaller files load faster in web maps — here's how to do it free online.

GeoJSON files can grow surprisingly large. A country boundary exported from a GIS at full resolution may contain hundreds of thousands of coordinate pairs when a fraction of them would render identically at typical zoom levels. Simplification removes redundant vertices while preserving the overall shape, producing smaller files that load faster, cost less to serve, and behave better inside every web mapping stack. This guide explains the concept, the trade-offs, and the practical steps you can take today using free online tools.

1. Why Simplify GeoJSON?

There are several concrete reasons to simplify GeoJSON before using it in production.

  • Web map performance. Rendering a polygon with 50,000 vertices in a browser is far more work than rendering the same shape with 2,000 vertices. At zoom level 5, the difference is invisible to the user but the frame rate difference is not.
  • Mapbox tile limits. Mapbox enforces limits on the number of vertices per tile. Overly detailed geometries cause features to be clipped or dropped entirely, leading to broken boundaries on the map.
  • GitHub file size limits. GitHub warns at 50 MB and hard-limits at 100 MB. A high-resolution world administrative boundary file frequently exceeds both thresholds before simplification.
  • API payload size. Sending a 15 MB GeoJSON payload to a REST API on every request wastes bandwidth and increases latency. A simplified 200 KB version of the same dataset is often sufficient for the intended use case.

Simplification is not always the right answer — see section 3 — but for visualisation-focused datasets it is one of the highest-impact optimisations available.

2. How GeoJSON Simplification Works

The most widely used simplification algorithm is Douglas-Peucker (also called the Ramer-Douglas-Peucker algorithm). It works recursively: given a line segment from the first to the last point in a sequence, it finds the point that deviates most from that segment. If the deviation is smaller than a threshold called epsilon (or tolerance), all intermediate points are discarded. If the deviation is larger, the sequence is split at that point and the algorithm is applied again to each half.

The epsilon tolerance controls the trade-off between geometric detail and file size:

  • A small epsilon removes only the most redundant vertices. The shape barely changes and file size reduction is modest.
  • A large epsilon removes far more vertices. File size drops significantly but corners become rounded and fine detail is lost.

In practice you iterate: start with a moderate tolerance, preview the result on a map, and tighten or loosen until the visual quality at your target zoom level is acceptable. There is no single correct value — it depends on the geometry type, the scale of your data, and the zoom levels your map supports.

3. When to Simplify vs. When Not To

Simplification is appropriate for some datasets and destructive for others. The key question is whether precision at the vertex level matters for the intended use.

Good candidates for simplification:

  • Country and administrative boundaries used for choropleth maps or visualisation.
  • Natural features such as coastlines, rivers, and forest extents at regional or global scales.
  • Any polygon or line dataset that will only ever be viewed at small scale (zoom 0–10).

Poor candidates — do not simplify:

  • Precise survey data. If the coordinates represent legally significant measurements, simplification changes the geometry in ways that may invalidate the survey.
  • Property or cadastral boundaries. Even a small shift in a boundary vertex can place a point on the wrong side of a parcel line.
  • Data that will be used for spatial analysis. Area calculations, intersection tests, and buffer operations all depend on vertex accuracy. Simplifying before analysis introduces error.

When in doubt, keep the original file intact and only use a simplified copy for the rendering layer.

4. Online Tools for Simplifying GeoJSON

Several free tools can simplify GeoJSON without requiring any local software installation.

  • Mapshaper.org — the gold standard for browser-based simplification. Supports Douglas-Peucker and Visvalingam-Whyatt algorithms, live preview, topology preservation, and export to GeoJSON, TopoJSON, Shapefile, and more. It handles files up to several hundred megabytes in the browser alone.
  • GeoDataTools simplifier (coming soon). GeoDataTools is planning a built-in simplification tool as part of its GeoDataTools tools suite. For now, Mapshaper is the recommended option for simplification. Once you have a simplified file, you can load and inspect it with the GeoDataTools viewer.
  • Turf.js simplify — a JavaScript function you can call programmatically. Useful when simplification is part of a larger data-processing pipeline in Node.js or a browser application. It accepts a GeoJSON Feature or FeatureCollection and returns a simplified copy.

5. Step-by-Step with Mapshaper

Mapshaper is the most capable free online simplification tool available. Here is how to use it:

  1. Upload your file. Go to mapshaper.org and drag your GeoJSON file onto the import dialog. Mapshaper will render the geometries immediately.
  2. Open the console. Click the Console button in the top-right corner. The command interface gives you precise control over simplification settings.
  3. Run the simplify command. Type a command such as:
    -simplify 20% keep-shapes
    This retains 20% of the original vertices. The keep-shapes flag prevents very small polygons from disappearing entirely when their vertices are removed. Adjust the percentage and preview the result on the map.
  4. Try topology preservation. If your dataset contains adjacent polygons (e.g., a country subdivided into provinces), add the planar or use the default topology-aware mode to keep shared borders aligned:
    -simplify 15% keep-shapes
    Mapshaper preserves topology by default when the layer contains shared edges, which prevents gaps and overlaps from appearing between adjacent features.
  5. Export the result. Click Export, choose GeoJSON as the format, and download. Compare the file size with the original before deploying.

After downloading, open the simplified file in the GeoDataTools viewer to do a final visual check before using it in production.

6. Reducing File Size Without Simplification

Simplification is the most powerful tool for reducing GeoJSON size, but it is not the only one. If preserving every vertex is important, consider these alternatives:

  • Remove unused properties. GeoJSON properties are often exported with every attribute in the source dataset, most of which the map never reads. Strip properties down to only what the application needs. A feature with 40 text properties can easily shed 500 bytes per feature — multiplied across thousands of features that adds up quickly.
  • Round coordinates to 5 decimal places. Five decimal places give approximately 1-metre accuracy at the equator, which is sufficient for most web map use cases. Reducing from 15 to 5 decimal places typically cuts coordinate storage by 30–50%. In Mapshaper use -o precision=0.00001 during export.
  • Convert to TopoJSON. TopoJSON encodes shared borders once rather than duplicating them across every polygon that touches them. For datasets with many adjacent polygons (administrative boundaries, land-use maps), TopoJSON files are typically 60–80% smaller than equivalent GeoJSON. See our TopoJSON vs GeoJSON guide for a detailed comparison. Note that TopoJSON requires a decoding step in the browser before it can be passed to most mapping libraries.
  • Minify the JSON. Removing whitespace and indentation from pretty-printed GeoJSON reduces size by 10–20% at no cost to data quality. Most GIS export tools offer a compact or minified output option.

These techniques can be combined: round coordinates, remove unused properties, minify, and then serve with gzip compression. Together they can reduce a file to a quarter of its original size without touching a single vertex.

7. Simplification Best Practices

Follow these guidelines to get the best results from simplification and avoid common pitfalls.

  • Always keep the original file. Simplification is lossy and irreversible. Store the full-resolution source in version control or object storage and only deploy the simplified version to production. Never overwrite the original.
  • Preview on a map after every step. Numerical metrics like vertex count and file size do not tell you whether thin peninsulas have vanished or coastline detail has become blocky. Load the result into the GeoDataTools viewer or Mapshaper's own preview pane at your target zoom levels before accepting the output.
  • Use topology-preserving mode for adjacent polygons. When two polygons share a border — provinces within a country, land-use parcels, census tracts — simplifying each polygon independently causes their shared edge to shift differently, creating slivers and gaps. Always use a topology-aware simplifier (Mapshaper does this by default) when working with multi-polygon datasets.
  • Match tolerance to zoom level. A tolerance suitable for a world map (zoom 0–3) will visibly degrade a city-level map (zoom 12–16). If your application spans a wide zoom range, consider generating multiple simplified versions — one per zoom range — and switching between them as the user zooms in.
  • Document the simplification parameters. Record what tool you used, the algorithm, the tolerance, and the original source. This makes it possible to reproduce the simplified file if the source data is updated or if a different tolerance is needed later.

Simplification is one step in a broader workflow. Combine it with validation, coordinate rounding, and property pruning to produce GeoJSON that is fast, clean, and production-ready. Load your optimised file into the GeoDataTools viewer to confirm everything looks correct, and explore the full range of format conversion and inspection features available in GeoDataTools tools.

Ready to work with your geospatial data?

Visualize, filter, and convert GeoJSON and KML files directly in your browser.

Try GeoDataTools