GeoJSON to WKT Converter

Convert GeoJSON geometries to Well-Known Text format for use in databases like PostGIS.

Skip to the tool

Well-Known Text is the lingua franca of spatial databases. Every INSERT into a PostGIS, SQL Server, or Oracle Spatial geometry column eventually needs WKT (or its binary cousin WKB). When you have a GeoJSON file from a web tool and need to pipe it into a psql session, this conversion is the bridge.

Paste a Feature or Geometry on the left and the converter emits the equivalent WKT string on the right — POINT(-73.96 40.78), LINESTRING(...), POLYGON((...)), or the MULTI* variants. FeatureCollections produce a GEOMETRYCOLLECTION. Properties are dropped because WKT has no attribute slot — keep them in a parallel column.

Below the converter you'll find the ST_GeomFromGeoJSON alternative (skip the conversion entirely if your Postgres ≥ 9.5), notes on SRID prefixes (SRID=4326;POINT(...)), and the EWKT extension PostGIS uses. For deeper PostGIS patterns, see the PostGIS and GeoJSON guide.

Watch out for: WKT's coordinate ordering — it's the same as GeoJSON (longitude latitude) but written without commas inside a coordinate pair, only between pairs. POINT(-73.96 40.78) is correct; POINT(40.78, -73.96) parses but plots in the Indian Ocean. The other recurring trap is the empty geometry: GeoJSON allows a Feature with "geometry": null, but standard WKT does not. This converter emits POINT EMPTY in that case, which PostGIS accepts but SQL Server does not.

What Is WKT?

WKT (Well-Known Text) is a compact text format for representing geometry objects. It is the standard geometry format used by spatial databases like PostGIS, Oracle Spatial, and SQL Server. WKT represents only geometry — it does not include properties or feature metadata like GeoJSON does.

How the Conversion Works

Each geometry in your GeoJSON is converted to its WKT equivalent. For FeatureCollections with multiple features, each geometry is output on its own line. Properties are not included since WKT is a geometry-only format.

WKT geometry type mapping:

WKTPoint        → POINT (lon lat)
LineString   → LINESTRING (lon lat, lon lat, ...)
Polygon      → POLYGON ((lon lat, lon lat, ...))
MultiPoint   → MULTIPOINT ((lon lat), (lon lat), ...)

Common Use Cases

  • Inserting geometries into PostGIS using SQL INSERT statements
  • Passing geometries to spatial SQL functions like ST_Intersects or ST_Buffer
  • Sharing geometries in contexts where JSON is not supported
  • Debugging spatial queries by inspecting geometry text
SQLINSERT INTO locations (name, geom)
VALUES ('Empire State', ST_GeomFromText('POINT (-73.9857 40.7484)', 4326));

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

Try It

Paste this GeoJSON LineString representing a segment of the Las Vegas Strip. The converter outputs the equivalent WKT string:

GeoJSON{
  "type": "Feature",
  "properties": { "name": "Las Vegas Strip" },
  "geometry": {
    "type": "LineString",
    "coordinates": [
      [-115.1728, 36.1147],
      [-115.1726, 36.1192],
      [-115.1722, 36.1251]
    ]
  }
}

The resulting WKT output:

WKTLINESTRING (-115.1728 36.1147, -115.1726 36.1192, -115.1722 36.1251)

Properties like name are discarded because WKT is a geometry-only format. If your FeatureCollection contains multiple features, each geometry is output on a separate line.

How the Conversion Algorithm Works

The converter reads each geometry from the GeoJSON input and serializes it to WKT syntax. Coordinate arrays are joined with spaces between longitude and latitude, and commas between coordinate pairs. Polygon rings are wrapped in double parentheses per the WKT standard. Multi-type geometries produce their corresponding WKT Multi-type keywords.

WKT is the format expected by spatial SQL functions such as ST_GeomFromText() in PostGIS. For a full reference on how GeoJSON structures map to database formats, see the PostGIS GeoJSON Guide.