WKT to GeoJSON Converter

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

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.