WKT to GeoJSON Converter

Convert Well-Known Text geometries to GeoJSON format for web mapping and visualization.

Skip to the tool

A PostGIS query usually returns geometries as WKT or WKB. To render those rows on a Leaflet or Mapbox map you need GeoJSON — either ask the database to convert with ST_AsGeoJSON, or do the translation client-side from the WKT string the driver already gave you. This tool is the client-side path.

Paste a single WKT geometry — POINT, LINESTRING, POLYGON, the MULTI* variants, or a GEOMETRYCOLLECTION — and the converter emits the equivalent GeoJSON Geometry. Wrap it in a Feature to attach properties before passing to L.geoJSON(). SRID prefixes are tolerated and stripped.

Below the converter the body covers the WKT grammar this tool implements, the differences between WKT and EWKT, when to prefer WKB (binary, smaller, faster to parse) for large result sets, and the round-trip caveats. For the reverse direction, use the GeoJSON to WKT converter.

Watch out for: the EWKT vs. ISO WKT difference. PostGIS emits SRID=4326;POINT(-73.96 40.78) by default — that SRID=...; prefix is non-standard and trips up parsers expecting plain WKT (e.g. shapely.wkt.loads). This tool tolerates and strips the prefix, but if you copy the resulting GeoJSON into another tool and back to WKT, the SRID metadata is gone. Keep the SRID in a parallel column if you're storing arbitrary projections, and never assume an SRID-less WKT string is in WGS 84 just because it looks like longitude/latitude — projected coordinates in metres can fall well within the WGS 84 numeric range.

Converting WKT to GeoJSON

This tool parses Well-Known Text (WKT) geometry strings and converts them to GeoJSON format. Paste a WKT string and get a properly structured GeoJSON Feature that you can visualize on the map, copy, or download.

WKTPOINT (-73.9857 40.7484)

The tool supports all standard WKT geometry types.

Supported WKT Types

  • POINT → GeoJSON Point
  • LINESTRING → GeoJSON LineString
  • POLYGON → GeoJSON Polygon
  • MULTIPOINT → GeoJSON MultiPoint
  • MULTILINESTRING → GeoJSON MultiLineString
  • MULTIPOLYGON → GeoJSON MultiPolygon
  • GEOMETRYCOLLECTION → GeoJSON GeometryCollection

Where WKT Comes From

WKT is the standard text output format for spatial databases. You will commonly encounter WKT when:

  • Querying PostGIS with ST_AsText(geom):
SQLSELECT name, ST_AsText(geom) FROM locations;
-- Returns: POINT (-73.9857 40.7484)
  • Exporting geometries from Oracle Spatial or SQL Server
  • Reading spatial columns in data analysis tools
  • Debugging spatial functions that return geometry as text

To convert in the other direction, use the GeoJSON to WKT converter.

Try It

Paste this WKT polygon representing a simplified boundary of Central Park in Manhattan. The converter produces a GeoJSON Feature:

WKTPOLYGON ((-73.9812 40.7681, -73.9580 40.8006, -73.9498 40.7969, -73.9730 40.7644, -73.9812 40.7681))

The resulting GeoJSON output:

GeoJSON{
  "type": "Feature",
  "properties": {},
  "geometry": {
    "type": "Polygon",
    "coordinates": [[
      [-73.9812, 40.7681],
      [-73.9580, 40.8006],
      [-73.9498, 40.7969],
      [-73.9730, 40.7644],
      [-73.9812, 40.7681]
    ]]
  }
}

WKT does not carry properties, so the output Feature has an empty properties object. You can add properties manually after conversion or use a tool like the viewer to inspect the geometry on a map.

How the Parsing Algorithm Works

The parser tokenizes the WKT string by first identifying the geometry type keyword (POINT, LINESTRING, POLYGON, etc.) and then extracting the coordinate groups from the parenthesized expressions. Each coordinate pair is split on whitespace to produce a [longitude, latitude] array. Nested parentheses in POLYGON and MULTI types are mapped to the corresponding nested array structure in GeoJSON.

WKT is the standard output of PostGIS functions like ST_AsText(). For guidance on moving spatial data between PostGIS and GeoJSON, see the PostGIS GeoJSON Guide.