Draw two polygons on the map, or upload a GeoJSON file or a zipped Shapefile, then subtract one polygon from another and keep only the area that is left. Pick a color for the result and save it as a GeoJSON file — fast, in your browser, with no extra program needed. Open in full screen ↗
What Is a Polygon Difference, and Why You Need One
A polygon difference, also called an erase or a spatial subtract, takes two overlapping shapes and gives you back only the part of the first shape that is not covered by the second one. This is one of the most common tasks in GIS work: taking a protected zone out of a land parcel, removing a no-build buffer from a project site, or finding the part of one delivery zone that another store does not already cover.
How the Difference Is Worked Out
You pick two layers: an Input Layer (the shape you want to keep) and an Erase Layer (the shape you want to subtract). The tool looks at every polygon in the Input Layer and cuts away any part that falls inside the Erase Layer. What is left over becomes a brand new layer, so your original two layers stay untouched and ready to use again.
Only Polygons Work Here
This tool only accepts closed shapes: Polygon and MultiPolygon. Points and lines do not have an inside area, so a difference cannot be worked out for them. If your file has other shapes mixed in with polygons, the tool keeps only the polygons and tells you how many other shapes it did not use.
Working with Your Layers
Each polygon layer and each difference layer you make shows up as one row in the Layers list. From that row, you can turn the layer on or off, change its color, zoom the map to it, save it as GeoJSON, or delete it. None of these actions change any other layer. A difference result can even be picked again as an Input Layer or an Erase Layer for a next run, so you can chain several cuts together.
Watch: Polygon Difference Tool in Under a Minute
Prefer to watch instead of read? This short walkthrough covers adding two polygons and erasing one from the other to get the difference.
Real-World Use Cases
🚜
Farm Field Management
Precision farming teams subtract a flooded patch, a rocky corner, or an access road from a field boundary to work out the true plantable acreage for seeding and yield planning.
🌿
Environmental and Conservation Planning
Conservation groups subtract a protected wetland or reserve boundary from a proposed project site to show planners exactly which part of the site is still open for construction.
📡
Telecom Coverage Analysis
Network engineers erase the coverage circle of a nearby tower from a new tower's coverage area, to see the extra, non-overlapping ground the new tower would actually add.
📐
Land Parcels and Easements
Land surveyors and title companies subtract a utility easement or a right-of-way strip from a full land parcel to see the true buildable area that is left for an owner.
🏙️
Urban Planning and Zoning
City planners remove a park, a flood zone, or a protected heritage area from a district polygon to find out how much of the district is actually open for new development.
🚚
Retail and Delivery Zone Planning
Retail chains erase one store's delivery zone from a neighboring store's zone to define an exclusive service area with no overlap between the two locations.
Two Ways to Add Your Polygons
Add the polygons you want to work with using one of these methods, or use both together in the same session:
- Draw on the map: Click "Draw Polygon", then click the map to add each corner. Finish the shape with a double-click, the Enter key, or the "Finish" button. Draw at least two overlapping polygons so the difference has something to remove.
- Upload a file: Click "Upload" or drag a file onto the map — a GeoJSON/.json file, or a zipped Shapefile (.zip with .shp, .dbf and .shx inside). Each file becomes its own layer.
No file ready? Click "Sample Polygons" to add two overlapping test shapes right away. Once you have at least two polygon layers, pick one as the Input Layer, pick another as the Erase Layer, choose a result color, and click "Run Difference".
Common Questions
What is the difference between "difference" and "erase" in GIS?
They are the same operation under two common names. Desktop GIS programs like ArcGIS often call it "Erase", while spatial libraries like Turf.js and PostGIS call it "Difference". This tool uses both words so it is easy to find, either way you search for it.
What happens if my Erase Layer completely covers my Input Layer?
Then there is nothing left to keep, and the tool tells you the result is empty instead of creating a new layer with no shapes inside it.
What does a zipped Shapefile need to have inside?
One .zip file, with at least the .shp, .dbf and .shx parts of the Shapefile inside it. If the zip has more than one layer inside, each one loads as its own separate layer in the tool.
Is my map data sent to a server?
No. Drawing, file reading, and the difference math all run in your own browser, using the Turf.js library. Nothing is sent to or kept on a server, so it is safe to use with private or sensitive location data.
Can my Input Layer or Erase Layer have more than one polygon?
Yes. If the Input Layer has several polygon features, the tool works out the difference for each one separately, checking it against every polygon in the Erase Layer, and puts every non-empty result into one output layer.
Why does my file get rejected?
This happens when the file has no Polygon or MultiPolygon shapes at all — for example, a file with only points or only lines. Check that your source file really has closed area shapes, not just points or paths.
Can I use points or lines as input?
No. This tool only works with Polygon and MultiPolygon shapes, since only a closed shape has an inside area that can be cut. If your file has points or lines mixed in with polygons, those extra shapes are left out, and you get a message about how many were left out.
Can I run the tool again on my own result?
Yes. A difference result is just another polygon layer, so you can pick it again as the Input Layer or the Erase Layer for a further run. This lets you chain several cuts together, one after another.
Can I change the color of a layer after I make it?
Yes. Every row in the Layers list has its own color box. Click it and pick a new color — the change shows on the map right away, and it does not touch any other layer.
What does "polygon difference" mean, in simple words?
It means taking one shape and cutting away any part of it that is covered by a second shape. What is left over — the part of the first shape that the second shape does not touch — becomes your new result.
Step by Step
1Step 1
Open the tool
The map opens on a world view with no layers yet. The toolbar at the top has Draw Polygon, Upload, Sample Polygons and a basemap switch. The sidebar has the difference tool, the layer list, and the export button.
2Step 2
Add your first polygon
Click "Draw Polygon" and click the map for each corner, or upload a GeoJSON file or a zipped Shapefile. This becomes your Input Layer — the area you want to keep.
3Step 3
Add a second, overlapping polygon
Draw or upload a second shape that overlaps the first one. This becomes your Erase Layer — the area you want to cut out. Or click "Sample Polygons" to add two ready-made overlapping shapes.
4Step 4
Pick the Input Layer
Open the "Input Layer" list in the sidebar and pick the layer whose area you want to keep.
5Step 5
Pick the Erase Layer
Open the "Erase Layer" list and pick the layer you want to subtract from the Input Layer.
6Step 6
Choose a result color
Click the color box next to "Result Color" and pick a color for the new difference layer.
7Step 7
Click Run Difference
The tool cuts the Erase Layer out of the Input Layer and adds a new layer with only the area that is left. The map zooms to fit the new shape.
8Step 8
Check and manage your layers
In the Layers list, turn any layer on or off, change its color, zoom to it, or delete it. Difference layers are marked differently from source polygon layers, so you always know which is which.
9Step 9
Save your results
Click the download icon on a layer row to save just that layer, or click "Download All Layers" to save every layer — inputs, erase shapes, and results — in one GeoJSON file.
Layer Colors and Result Style
Two color settings help you tell layers apart on the map:
- Layer color: each polygon layer gets its own color when you add it. You can change this color any time from the layer row.
- Result Color: sets the color of the new difference layer before you click "Run Difference". Change it again after, from the layer row, if you want a different look.
The new difference layer is drawn with a bolder outline and a stronger fill than the source layers, so the result always stands out on the map.
Saving Your Difference Result
Two ways to save your work are always ready in the sidebar:
- Save one layer: click the download icon next to any layer row to save only that layer as a GeoJSON file.
- Download All Layers: puts every layer on the map — inputs, erase layers, and difference results together — into one GeoJSON file, with each feature marked with its layer name.
GeoJSON opens without problems in Leaflet, Mapbox GL JS, QGIS and ArcGIS, and it even shows as a live map on GitHub.
More Tools You Might Like
Map tiles © OpenStreetMap contributors and Protomaps (hosted by KONAKTIVE), CARTO, Esri (satellite). Difference math powered by Turf.js. Shapefile parsing by shpjs. Map rendering by Leaflet. All drawing, file reading and difference calculation is local — no data is uploaded to any server.