Don't like ads? Go Ad-Free Today

GeoJSON ↔ WKT Spatial Data Converter

DataDeveloper
ADVERTISEMENT · REMOVE?
Accepts GeoJSON Feature, FeatureCollection, or raw Geometry. WKT supports POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION.
Number of decimal places. Trailing zeros are trimmed.

Detection

Paste GeoJSON or WKT input to see results.

Map Preview


Coordinate Order Cheat Sheet

Both GeoJSON and WKT in the EPSG:4326 reference system order coordinates as longitude latitude (X then Y). The most common AI mistake is swapping them to latitude longitude when reading data labeled "lat/lon". This tool preserves the original ordering.

Polygon nesting: GeoJSON coordinates is [ring0, ring1, …] where ring0 is the exterior ring and the rest are holes. WKT writes the same structure as POLYGON ((outer), (hole1), (hole2)). Rings must be closed — first and last points must be identical.
ADVERTISEMENT · REMOVE?

Guide

GeoJSON ↔ WKT Spatial Data Converter

GeoJSON ↔ WKT Spatial Data Converter

Convert geometries back and forth between GeoJSON and WKT (Well-Known Text) without ever wondering whether your coordinates got swapped. Paste either format, pick a direction (or let auto-detect do it), and watch the geometry render on a live OpenStreetMap preview so you can verify the shape before it goes into your database, map tile, or GIS pipeline.

How to Use

  1. Paste a GeoJSON geometry, Feature, FeatureCollection, or a WKT string into the input box.
  2. Leave Direction on Auto-detect, or pick the explicit direction if your input is ambiguous.
  3. Choose a coordinate precision if you want to trim long decimals; the default keeps the full value.
  4. Toggle Pretty-print GeoJSON for indented JSON output, and Uppercase WKT for canonical type keywords.
  5. Use Swap & Round-trip to feed the current output back as input — useful for sanity-checking a conversion.

Features

  • Bidirectional conversion – GeoJSON → WKT and WKT → GeoJSON in a single tool.
  • Full geometry coverage – Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection.
  • Z, M, and ZM coordinates – parses 3D and measured WKT (POINT Z, POINT ZM) and preserves the extra ordinates in the GeoJSON output.
  • EMPTY geometry support – round-trips POINT EMPTY, POLYGON EMPTY, etc. without errors.
  • Feature and FeatureCollection input – unwraps a single Feature or collapses a FeatureCollection into a GeometryCollection.
  • Live OpenStreetMap preview – renders the geometry via Leaflet so you can spot a swapped latitude/longitude immediately.
  • Adjustable precision – round to anywhere between 4 and 8 decimal places, or keep full precision.
  • Auto-detect input – sniffs the first character to choose between JSON parsing and WKT tokenisation.
  • Copy and download – grab the converted text in one click for use in PostGIS, Shapely, Mapbox, or any other GIS tool.

FAQ

  1. Why do GeoJSON and WKT order coordinates as longitude before latitude?

    Both formats follow the mathematical convention that the X axis comes before the Y axis, and in the EPSG:4326 reference system X maps to longitude and Y maps to latitude. The OGC and IETF specifications (RFC 7946 for GeoJSON and OGC 06-103r4 for WKT) codified this ordering to keep geometry libraries interoperable. Human-friendly labels like "lat, lon" reverse this order, which is the single most common cause of points landing in the wrong hemisphere.

  2. What is the difference between a Polygon and a MultiPolygon?

    A Polygon is one continuous filled area with an exterior boundary and zero or more interior holes, expressed in WKT as POLYGON ((outer ring), (hole), ...). A MultiPolygon is a set of separate Polygons treated as a single feature — useful when a single country or region is made of several disconnected landmasses. In GeoJSON the nesting deepens by one level for MultiPolygon: coordinates becomes [polygon][ring][point] instead of [ring][point].

  3. What does it mean for a polygon ring to be closed?

    A linear ring is closed when its first and last coordinate pairs are identical. GeoJSON RFC 7946 requires every polygon ring to be closed, and WKT validators typically enforce the same rule. If you build a ring from a list of vertices, always re-append the first vertex at the end before serialising.

  4. What are the Z and M dimensions in WKT?

    Z is an elevation (or any third spatial axis), M is a measure (often time, distance along a route, or a sensor reading). WKT marks them with a suffix on the type — POINT Z (1 2 3), POINT M (1 2 3), POINT ZM (1 2 3 4). GeoJSON allows optional third and fourth values inside each coordinate array but does not formally distinguish Z from M; the recommended convention is [lon, lat, elevation].

  5. When should I use a GeometryCollection?

    A GeometryCollection holds heterogeneous geometries — say, a Point and a Polygon — as one entity. It is helpful for grouping related features that do not share a type, but many GIS systems (notably PostGIS spatial indexes and some web mapping libraries) handle simpler types more efficiently, so prefer MultiPoint, MultiLineString, or MultiPolygon when every part shares the same geometry type.

Want To enjoy an ad-free experience? Go Ad-Free Today

Install Our Extensions

Add IO tools to your favorite browser for instant access and faster searching

Add to Chrome Extension Add to Edge Extension Add to Firefox Extension Add to Opera Extension

Scoreboard Has Arrived!

Scoreboard is a fun way to keep track of your games, all data is stored in your browser. More features are coming soon!

ADVERTISEMENT · REMOVE?
ADVERTISEMENT · REMOVE?
ADVERTISEMENT · REMOVE?

News Corner w/ Tech Highlights

Get Involved

Help us continue providing valuable free tools

Buy me a coffee
ADVERTISEMENT · REMOVE?