The Short Answer
To validate GeoJSON, paste your file into a free GeoJSON validator. It checks your file against the official GeoJSON specification and lists every problem it finds, usually with a line number. Fix the flagged issues, paste it in again, and repeat until you get a clean pass. Most files are fixed in under five minutes.
"Valid" here has a specific meaning: your file must be well-formed JSON first, and then it must follow the GeoJSON structure rules on top of that. A file can look perfectly fine to your eyes and still fail because of one misplaced comma. The validator catches what your eyes miss.
What "Valid" Actually Means
GeoJSON is not a loose convention — it is a formal standard called RFC 7946, published in 2016. The spec defines exactly which objects are allowed (Point, LineString, Polygon, and a few more), exactly what fields each one needs, and exactly how coordinates must be written.
Validation is a two-layer check. Layer one: is this legal JSON? Every bracket must close, every comma must sit between two values, every string must be quoted. Layer two: does the JSON follow the GeoJSON rules? A geometry needs a "type" field with a recognized value. A Point needs a "coordinates" array with numbers in it. A Polygon's rings must close back on themselves.
Most validators run both layers at once and report everything in plain language. "Unexpected token at line 42" is layer one. "Polygon ring is not closed" is layer two. Knowing which layer your error lives on tells you where to look.
The Errors You Will See Most
After watching thousands of files go through validation, the same handful of mistakes accounts for nearly everything:
- Trailing commas. {"name": "Austin",} — that comma after the last item is illegal in JSON, even though JavaScript lets it slide. Delete it.
- Unclosed brackets or braces. Somewhere a [ never met its ]. Validators usually point at the line where things fall apart, which is often a few lines after the actual missing bracket.
- Coordinates in the wrong order. GeoJSON demands longitude first, then latitude: [-97.7431, 30.2672] for Austin, Texas. Writing [30.2672, -97.7431] is valid JSON but puts your point somewhere in the wrong hemisphere.
- Strings that are not quoted. {type: Point} fails. {"type": "Point"} passes. Keys and string values always need double quotes — single quotes do not count.
- Numbers stored as strings. "coordinates": ["-97.7431", "30.2672"] looks right but fails, because coordinates must be actual numbers, not text.
- Missing or misspelled "type". Every GeoJSON object needs "type": "FeatureCollection", "Feature", "Point", and so on, spelled exactly right, capital P included.
How to Validate, Step by Step
Here is the workflow that works every time:
- Copy your file's contents. Open the .geojson file in any text editor and select all. If it came from an export, grab it fresh rather than a version you already hand-edited.
- Paste it into the validator. Use a free GeoJSON validator that runs in your browser — your data stays on your machine, which matters if the file contains anything sensitive.
- Read the first error only. Validators list every problem, but errors cascade: one missing bracket early on can generate ten phantom errors downstream. Fix the first one and re-check.
- Re-validate after each fix. Paste the corrected text back in. The error list should shrink. Repeat until it is empty.
- Do a visual sanity check. Validation proves the structure is legal, not that the data is right. Load the file in a KML/GeoJSON viewer and confirm your points land where you expect.
This loop — paste, read, fix, repeat — sounds tedious, but each round takes seconds, and most files converge in two or three rounds.
Longitude Comes First: The Number-One Gotcha
If you remember one thing from this guide, make it this: in GeoJSON, coordinates are [longitude, latitude]. Longitude first. Always.
This trips up nearly everyone, because in everyday speech we say "lat/long" — latitude first. Google Maps URLs, most GPS displays, and casual conversation all put latitude first. GeoJSON deliberately does the opposite, matching the mathematical convention of x (horizontal) before y (vertical).
The cruel part: swapping them still produces perfectly valid GeoJSON. The validator will pass it with flying colors. Your point for downtown Chicago [41.8781, -87.6298] written backwards becomes [-87.6298, 41.8781] — valid syntax, but it lands in the ocean south of nowhere useful. Always eyeball your data on a map after converting or hand-writing coordinates.
Fixing Errors Without Rewriting the File
You rarely need to start over. Most fixes are surgical:
- For trailing commas and bracket mismatches, let a JSON formatter do the hunting. Paste your text into any JSON formatter first — it highlights the exact trouble spot, often more precisely than the GeoJSON validator.
- For coordinate order, a quick find-and-replace rarely works safely, but many converters have a "swap coordinates" option. If your data came from a KML or GPX conversion, re-export with the coordinate order checked rather than hand-editing hundreds of points.
- For unclosed polygon rings, copy the first coordinate pair of the ring and paste it at the end. A valid ring starts and ends at the same point.
- For numbers stored as strings, search for ": "" patterns near your coordinates and remove the quotes around numeric values.
After each round of surgery, re-validate. Think of the validator as a spell-checker: run it early, run it often.
Big Files Need a Different Approach
Browser-based validators are wonderful up to a point — usually a few megabytes. Past that, pasting a 200 MB file into a web page gets slow or crashes the tab. For heavy files:
- Split the file. If it is a FeatureCollection, break it into smaller collections. Validate each chunk separately — an error in chunk 3 of 12 is much easier to find.
- Simplify geometries. Tools like QGIS or command-line utilities can reduce vertex counts on complex polygons. Fewer vertices means a smaller file and fewer chances for a malformed ring.
- Validate at the source. If the file came from a database export or an API, check whether the exporter has a "strict" or "RFC 7946 compliant" mode. Fixing the pipeline beats fixing every file by hand.
- Check encoding. Large files exported from older systems sometimes arrive in encodings other than UTF-8, which the spec requires. Re-saving as UTF-8 clears a whole class of mysterious failures.
Valid Is Not the Same as Correct
This distinction deserves its own section because it bites professionals too. A file can be 100% valid GeoJSON and still be wrong: every bracket closed, every ring shut, every coordinate a proper number — and all your store locations plotted in the middle of the Atlantic.
Validation checks structure, not truth. After the validator gives you a clean pass, do these reality checks:
- Zoom out. Load the file on a map. Do the points fall on the right continent? The wrong-hemisphere mistake is instantly visible at world scale.
- Check the count. Does the file contain the 400 stores you expected, or 39? A truncated export validates fine but is missing data.
- Spot-check attributes. Open two or three features and confirm the names and values match what you expect. Column shifts during export are invisible to validators.
- Confirm the coordinate system. GeoJSON is always WGS84 (plain GPS coordinates). If your source data was in some local projection, the numbers need converting first — otherwise your valid file shows valid-looking points in the wrong place.
Keeping Files Valid From the Start
The best fix is prevention, and it is mostly about habits:
- Export, do not hand-write. Whenever possible, generate GeoJSON from GIS software, a database, or a converter rather than typing it. Machines do not add trailing commas.
- Name the standard. When a tool offers "GeoJSON" and "GeoJSON (strict/RFC 7946)", pick the strict one. Some exporters include non-standard extras that trip strict readers.
- Keep a validator bookmarked. Make the GeoJSON validator part of your routine: export, validate, then share. Thirty seconds now saves a confusing bug report later.
- Version your files. When you hand-edit, save a copy first. If an edit breaks validation beyond quick repair, you can diff against the last good version instead of starting over.
Copy-Paste Patterns for the Five Most Common Errors
It helps to see what broken and fixed actually look like side by side. Here are the patterns to recognize, described so you can spot them in your own file:
- The trailing comma. Broken: a properties block ending with "city": "Austin", followed by a closing brace. Fixed: remove that last comma so the final value has no comma after it. This one error causes a huge share of all validation failures, and it takes two seconds to fix once you see it.
- The unclosed polygon ring. Broken: a polygon whose coordinate list starts at [-97.74, 30.27] but ends at some different point. Fixed: repeat the starting pair at the very end of the list. The spec requires every ring to close, and validators flag open rings explicitly.
- The swapped coordinates. Broken: a Chicago point written as [41.8781, -87.6298]. Fixed: flip it to [-87.6298, 41.8781], longitude first. Remember, the validator cannot catch this one — only a glance at a map can.
- The stringified number. Broken: "coordinates": ["-97.7431", "30.2672"]. Fixed: drop the quotes so the values are real numbers: [-97.7431, 30.2672]. This usually happens when data passes through a spreadsheet, which loves turning everything into text.
- The lowercase type. Broken: "type": "point" or "type": "featurecollection". Fixed: capitalize exactly as the spec wants — "Point", "FeatureCollection", "LineString", "Polygon". The type names are case sensitive, and this mistake is invisible until validation.
Keep this list open in a tab while you fix. Match the pattern, apply the fix, re-validate, and move to the next error. Most files need only one or two of these.
Why Some Valid Files Still Break in Certain Tools
Here is a frustration nobody warns you about: your file passes validation cleanly, then one specific tool refuses to open it. The file is not broken — the tool is simply pickier than the spec requires.
Every mapping library draws the line somewhere. One popular web-map library chokes on 3D coordinates — that third altitude number — even though the spec allows them. A desktop GIS program might reject a FeatureCollection that mixes Points and Polygons, which is technically legal but unusual. Some older tools stumble on null geometries, where a feature carries "geometry": null because it has attributes but no location yet. All perfectly valid, all occasionally rejected.
Extra fields are another classic. The spec lets you add your own custom fields to a GeoJSON object, and most modern tools ignore them gracefully. But a strict importer built for one specific workflow can treat any unexpected field as an error. If your file came from a specialized exporter, those extras are the first thing to suspect when a picky tool complains.
The fix is practical: validate first with the GeoJSON validator to confirm the structure is sound, then test in the actual tool you plan to use. If it balks, simplify — drop 3D coordinates down to 2D, split mixed collections by geometry type, remove null geometries, and strip non-standard extras. A file that is both valid and boring opens everywhere.
When a tool throws a cryptic error, look for a "supported GeoJSON" note in its documentation. The gap between "valid per the spec" and "accepted by this app" is where most of these mysteries live — and knowing that saves hours of re-validating a file that was never the problem.
Check Your File Now
You already know the whole process: paste, read the first error, fix, repeat, then eyeball it on a map. Open the free GeoJSON validator and run your file through it. If it passes clean, convert or share it with confidence — and if you need it in another format afterward, a GeoJSON to KML converter is one click away.
