Dev tools

GeoJSON ↔ CSV

Convert GeoJSON Point features to CSV rows and back. LineString/Polygon geometries export as a flattened coordinate list (one-way; CSV->GeoJSON always builds Points). CSV parsing is fully quote-aware (src/csv.ts), so a quoted field holding a comma or a newline no longer shifts the coordinate columns. Runs on your device.

Runs on your device. The file is never uploaded.

GeoJSON to CSV writes one row per feature, with lat and lon first, then a column for each property key present, then geometry_type. The latField and lonField options rename those two columns and default to lat and lon. A LineString or Polygon flattens into the geometry_type cell and never comes back, because csv-to-geojson only builds Points.

Input

Options

Questions

Which direction does it convert?

Both, chosen with the mode option: geojson-to-csv, the default, or csv-to-geojson. The latField and lonField options name the coordinate columns and default to lat and lon. Drop a file, pick the direction, and the result is printed as text on the page for you to copy.

What columns come out of a GeoJSON file?

The lat and lon columns first, then one column for every property key found across all the features, then a geometry_type column. A feature missing a property gets an empty cell. The input can be a single Feature or a FeatureCollection; anything else is refused with "expected a GeoJSON Feature or FeatureCollection".

What happens to lines and polygons?

They are exported but do not round trip. A LineString or Polygon leaves lat and lon empty and has its coordinates flattened into the geometry_type cell, as the type name followed by lat,lon pairs separated by spaces. A Polygon contributes its first ring only. Going the other way always builds Points, one per CSV row.

Does it handle commas inside quoted CSV fields?

Yes. Parsing goes through the shared quote-aware CSV reader, so a field such as "Smith, John" stays one value and does not shift the coordinate columns. That was a real bug once: a naive split on commas put a null longitude into output that claimed to be GeoJSON.

Why does it say my CSV header is missing columns?

Because no header cell matches latField or lonField. The message names both, saying the header must include "lat" and "lon" columns. Header cells are trimmed but matched exactly and with case, so Latitude, LAT and lat are three different names. Set the two options to whatever your file calls them.

Do property values keep their types?

Not going from CSV to GeoJSON. Every non-coordinate column becomes a string property, so a population of 1000 arrives as "1000". Only the coordinates are turned into numbers. In the other direction values are written out with a plain string conversion, so a nested object or array will not survive in a useful form.

Related Dev tools

n→nJSON ↔ CBOREncode JSON to CBOR bytes (shown as hex) or decode CBOR bytes back to JSON. Covers uint/negint/text/array/map/float/bool/null; no byte strings, tags, or indefinite-length items.Runs on each file you dropn→nJSON ↔ MessagePackEncode JSON to MessagePack bytes (shown as hex) or decode MessagePack bytes back to JSON. Covers nil/bool/int/float64/str/array/map: no bin, ext, or timestamp extension types.Runs on each file you dropn→nJSON ↔ RisonConvert JSON to Rison (the compact URI-safe notation Kibana/Elasticsearch use for query params) and back. This tool's own encoder/decoder for the documented core grammar (no reference implementation in this codebase to check against). Exotic edge cases like embedded control characters or surrogate-pair characters are not guaranteed byte-identical to the reference grammar.Runs on each file you dropn→nPHP serialize / unserializeConvert JSON to PHP's serialize() format and back. Covers null/bool/int/float/string/array. PHP objects (O:) are not implemented since they need a class registry this tool doesn't have.Runs on each file you dropn→nPLIST viewerView an XML property list (.plist) as JSON. Binary plist (bplist00) is not supported. It needs a separate binary-format parser this tool does not implement.Runs on each file you dropn→nKML/GPX to GeoJSONConvert a GPX (waypoints/tracks/routes) or KML (Placemarks: Point/LineString/Polygon) file to GeoJSON. A hand-rolled tag scan, not a general XML parser: no styles, nested Folder hierarchy, MultiGeometry, or extended data.Runs on each file you drop