I have a small script that I'm using to generate GeoJSON data from a data format not currently supported by GIS software.

I would like to validate the output, but when I use ogr2ogr to read it, it doesn't give me any helpful information about what aspects, lines, or characters contained invalid data.

Is there a decent GeoJSON validator somewhere, or a good method of validating GeoJSON data with OGR?

EDIT: I am not looking for JSON validators or the GeoJSON spec. I've seen and used both to get to this point, but OGR still returns an error.


6 Answers 6


5 months late, but I made this thing that should help http://geojsonlint.com/.

  • 1
    I use your service all the time.. However, the error ";Line 1: Polygons and MultiPolygons should follow the right-hand rule" should not occur.
    – Jeryl Cook
    Commented Sep 23, 2017 at 15:10
  • does this have an npm library? Commented Jan 25, 2021 at 0:00

If you prefer JavaScript there are now two options

  • 2
    both are down ... Commented Jan 25, 2021 at 0:00

I have explained it before in this post.

The differences between JSON and GeoJSON are all about spelling. You can add more definition if you want. I don't think it is very important if you do not take part in the JSON spec for GeoJSON... there is no limit for a JSON object; the only important thing is that your JSON must be valid for correct usage.

You can check whether or not your GeoJSON file is valid with JSONLint which is a JSON Validator...

and you can check against the GeoJSON spec here.

I hope this helps you.

  • 1
    The GeoJSON spec is at geojson.org - you linked to GeoJSON CSS, an unofficial extension.
    – tmcw
    Commented Sep 17, 2012 at 0:14

This GeoJSON validator is extremely useful in parsing different types, but also helpfully points out exactly where the errors lie.


I don't have enough reputation to reply to comments, but apparently enough to add an answer. Go figure. For the links that @null_radix provided, here are the corresponding npm links that should still be valid:

The geojsonhint has been deprecated, but, as of the time of this comment, was still getting around 54K downloads per week, while geojson-validation was getting 15K.

  • FYI to anyone looking at these. They are for the old (deprecated) GeoJSON spec, not rfc7946.
    – Stonetip
    Commented Mar 25, 2022 at 18:10
  • @mapbox/geojsonhint is updated and current for the current spec. Commented Jul 12, 2023 at 7:15

There is a Java-based parser to validate a GeoJSON Structure written in Java Topology Suite (JTS). You can refer it here:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.