Broken geometry is the cockroach of GIS data: invisible in normal viewing, discovered only when something else fails. The polygon looks fine on the map. Then the area calculation returns nonsense, the spatial join drops it without a word, the export to another format errors out or, worse, succeeds with a silently altered shape. Underneath sits invalid geometry: a boundary that crosses itself in a figure eight, a ring with duplicate nodes, a spike where an editor's mouse slipped in 2014. QGIS ships the full professional workflow for this, a validity checker and a geometry fixer, and the discipline is a loop, not a single click: check, fix, check again, because the fixer changes data and only a clean re-check proves the repair. This guide runs that loop properly and explains the residue that still needs a human.
Home / GIS and Open Map Data for Beginners
Fix Geometry in QGIS: Find Invalid Polygons and Repair Them to Zero Errors

Photo: Ann Hannes / Pexels
Check, Repair, Re-Check: The Fix Geometry Checklist
Check off each step as you finish it. Your progress stays on this page.
0 of 8 complete
0% done
Why Geometry Breaks
Validity is a set of formal rules about how a geometry may be put together, defined by the OGC standards every GIS library implements. A polygon's rings must not cross themselves; a boundary may touch itself only in allowed ways; nodes must not duplicate pointlessly; a geometry must not collapse or spike. Real data violates these rules through ordinary life: digitizing slips, imports from CAD drawings that never enforced topology, format conversions that round coordinates until two distinct nodes land on the same spot, buffers and intersections computed at awkward angles, and edits made in software that did not check its own work. The reason invalid geometry matters is that downstream algorithms assume the rules hold. Area, intersection, union, and spatial selection all reason about inside and outside, and a self-crossing boundary makes inside and outside genuinely ambiguous, so each library improvises its own answer: one returns a number, another returns nothing, a third returns a different shape. If your results ever disagree between tools for no visible reason, suspect geometry before you suspect the tools. Readers meeting the concept for the first time may want our explainer on what a shapefile contains for the file-level context these geometries live in.
Diagnose: Check Validity
The diagnosis tool is Check Validity, in the Processing Toolbox under the vector geometry tools. It asks for the layer and a method, and the method choice matters: choose the GEOS method, the rigorous one that matches the validity rules the rest of the GIS world enforces, rather than the more forgiving QGIS-native method, because data that passes GEOS travels safely everywhere. Run it and you get up to three outputs: the valid features, the invalid features as their own layer, and an error layer of points, each point marking a problem location with a message saying what is wrong: self-intersection at a coordinate, ring self-intersection, duplicate node, too few points. That error layer is your worklist. Zoom to each point and look at the geometry with the map at large scale; most errors become visually obvious, the bowtie pinch, the doubled-back spike, once you are standing on top of them. Count the errors before fixing anything, because the count is your baseline: the loop ends at zero, and you cannot prove you arrived without knowing where you started.

Repair: Fix Geometries
The repair tool is Fix Geometries, also in the Processing Toolbox. Feed it the layer, run it, and it writes a new layer in which it has attempted to repair every feature: self-intersections get noded and re-assembled into valid rings, duplicate nodes are removed, collapsed parts are dropped, and the output carries a field or report indicating which features it changed. Two properties of the fixer deserve respect. First, it writes a new layer and leaves your original untouched, which is the correct posture: keep the source, work on the repair, promote it only after verification. Second, its repairs are decisions, not restorations: when a boundary crossed itself, the fixer must choose how the shape resolves, and its choice, while formally valid, may not be the shape the data meant. A figure-eight polygon might become two polygons, or one, with the lobe assignment decided by algorithm. On data you know well, inspect the changed features against the original and your knowledge of the ground. On bulk data of unknown provenance, the fixer plus the re-check is usually the pragmatic answer, with the caveat recorded in your project notes.
The Loop: Re-Check to Zero
Run Check Validity on the fixed layer, same GEOS method, and read the result like a verdict. Zero invalid features: the layer is clean, and you may proceed to the analysis, join, or export that broke in the first place, which will usually now behave. A reduced but nonzero count: the fixer repaired what it could and left the stubborn residue, often geometries so mangled that no algorithmic choice is safe, or features that became empty when their only valid interpretation was nothing. Those need the manual treatment of the next section. An unchanged count, or new errors: something is off in your workflow, most often checking a different layer than the one you fixed, or a format round trip that re-broke the data on save, in which case fix into a format with strong geometry handling, such as GeoPackage, rather than re-fixing into the same leaky container. The loop is the professional habit that separates "I clicked the fix button" from "the data is valid": only the second sentence may be said, and only the re-check entitles you to say it. This discipline pairs with the field calculator checks as the two halves of trusting a layer: valid shapes, honest attributes.
What the Fixer Cannot Do
Know the boundary of the tool. Fix Geometries repairs validity within features; it does not repair topology between features. Two adjacent parcels that overlap each other, or leave a sliver gap along their shared border, are each perfectly valid and jointly wrong, and no run of the fixer will notice, because that class of problem needs topology rules and human judgment about which boundary is authoritative. It cannot restore intent: a polygon whose spike was actually a real narrow inlet will be "repaired" into a lie with total confidence. It cannot fix attributes, wrong values riding on valid shapes, and it cannot help features whose problem is that they should not exist at all. The manual residue is handled in the vertex editor: enable editing, open the Vertex Tool, and correct the specific nodes the error layer flagged, deleting the duplicated point, uncrossing the bowtie by moving a vertex, then re-checking that one feature. Slow, surgical, and occasionally the only honest path. The mature workflow is therefore three-tiered: the fixer for the bulk, the vertex editor for the residue, and a final zero-error check as the gate through which data must pass before anything downstream is allowed to trust it.
Prevention: Stop Manufacturing Invalid Data
The cheapest repair is the one never needed, and most invalid geometry is manufactured at predictable moments. Digitizing is the first: drawing with snapping off, tracing hastily over imagery, and closing rings by eye all invite self-intersections and duplicate nodes, while snapping to existing vertices and a slower hand prevent most of them. Editing operations are the second: splitting and merging polygons, reshaping boundaries, and pasting features between layers with different precision all stress validity, and a validity check immediately after a heavy edit session, while you still remember what you intended, catches the damage at birth. Format tourism is the third: data that tours through formats with weaker geometry models, or through coordinate rounding at low precision, degrades a little at each border, so keep a canonical copy in a robust format and treat exports as expendable. The professional habit that binds these together is gating: validity checks at the moments data changes hands, on receipt from a supplier, before delivery to a client, before any analysis whose results will be quoted. Each gate costs a minute and converts a class of mysterious downstream failures into a short, named list of repairable defects. Fix Geometries will always have work; a gated workflow simply ensures its work is small, recent, and understood, rather than archaeological.
Reading a Validity Report Like a Diagnostician
The checker's list deserves one more skill: triage. Sort the reported errors by kind before repairing anything. A dataset with thousands of duplicate-node complaints and nothing else is telling you a precision story, usually a format conversion or a rounding event in its past, and the repair will be gentle and global. A handful of self-intersections concentrated in one corner of the map is telling you an editing story, one session, one operator, one bad afternoon, and the repair may deserve hand work because the shapes there encode someone's intent. Ring orientation and closure complaints scattered evenly suggest an export filter mangled the geometry model on the way in. And errors that appear in data you received, in exactly the fields a supplier's changelog mentions as re-digitized, are a conversation to have with the supplier before you repair anything, since your fix and their next delivery will otherwise chase each other forever. The report, read this way, is not a bill to pay but a history of the data written in its failures. Fix Geometries still does the paying. But the diagnostician knows which errors will recur, which were accidents, and which are evidence, and that knowledge is what turns a maintenance chore into data stewardship.
Related Guides
This guide does not stand alone. The GIS and open map data guides below take up the questions it leads into:
- The QGIS Attribute Table: Rows Are Places, Columns Are Facts: Every layer in QGIS is two things at once: the shapes on the map and the table behind them.
- The QGIS Georeferencer: Pin a Scanned Map to the Real World: A scanned historical map is a picture until you georeference it: teach QGIS a set of ground control points, places whose real coordinates you...
- QGIS Heatmap: The Renderer for a Picture, the KDE Algorithm for a Raster: QGIS offers two different things called heatmap, and choosing between them is the first skill: the heatmap symbology renderer draws a live density...
- QGIS Snapping: Enable It, Set the Tolerance, and Make Vertices Meet: keep new edits from needing the fix
- QGIS Vertex Tool: Move, Add, and Delete Vertices Without Redrawing: repair shapes vertex by vertex
Frequently Asked Questions
How do I check for invalid geometry in QGIS?
Run Check Validity from the Processing Toolbox, choosing the GEOS method for the rigorous standard rules. It outputs the valid features, the invalid features, and an error layer whose points describe each problem, such as a self-intersection, with its location.
Does Fix Geometries change my original data?
No. It writes a new repaired layer and leaves the source untouched. Inspect the features it changed, especially self-intersecting polygons where the repair involves a judgment about shape, then re-run Check Validity on the new layer to confirm zero errors before using it.
Why do my area calculations and joins fail on some polygons?
Invalid geometry is the usual suspect. A self-crossing boundary makes inside and outside ambiguous, so area, intersection, and spatial join algorithms return wrong answers, empty results, or errors for those features while working fine on valid ones.
What is the difference between validity and topology?
Validity is about each geometry obeying the formal construction rules by itself. Topology is about relationships between geometries, overlaps and gaps between neighbors. Fix Geometries addresses validity only; overlaps and sliver gaps between adjacent features need separate topology checks and manual decisions.
Why did errors come back after I saved the layer?
Some formats and round trips reintroduce problems, for example through coordinate rounding. Save repaired data into a robust format such as GeoPackage, then run Check Validity on the saved file itself, not just the in-memory layer, before trusting it.
Photo credits: Ann Hannes (Pexels); Mike van Schoonderwalt (Pexels). Photos are served from this site; follow the credit to the library page for the original.