More games at WuGames.ioSponsoredDiscover free browser games — play instantly, no download, no sign-up.Play

WKT GeoJSON Converter - Convert WKT to GeoJSON Online

Free WKT GeoJSON converter: convert WKT, EWKT and PostGIS output to/from GeoJSON FeatureCollection in WGS84. Validate and visualize geometries online.

What is WKT and GeoJSON?

WKT (Well-Known Text) is a text markup language for representing vector geometry objects. It's a standard format used in GIS software, databases (like PostGIS), and spatial data exchange.

GeoJSON is a JSON-based format for encoding geographic data structures. It's widely used in web mapping applications and provides a more verbose but human-readable representation of geometries.

Key differences:

  • Format: WKT is compact text, GeoJSON is JSON-based
  • Usage: WKT for databases/GIS, GeoJSON for web applications
  • Structure: WKT is simpler, GeoJSON includes properties and metadata
  • Support: WKT in spatial databases, GeoJSON in JavaScript libraries

WKT Format Examples

WKT represents geometries as text strings:

  • POINT: POINT(30 10)
  • LINESTRING: LINESTRING(30 10, 10 30, 40 40)
  • POLYGON: POLYGON((30 10, 40 40, 20 40, 10 20, 30 10))
  • MULTIPOINT: MULTIPOINT((10 40), (40 30), (20 20))
  • MULTILINESTRING: MULTILINESTRING((10 10, 20 20), (15 15, 30 15))

WKT is widely supported in spatial databases like PostGIS, MySQL Spatial, and Oracle Spatial.

GeoJSON Format Examples

GeoJSON represents geometries as JSON objects:

{
  "type": "Point",
  "coordinates": [30, 10]
}

GeoJSON can include feature properties and is the preferred format for web mapping libraries like Leaflet, Mapbox GL, and OpenLayers.

Common Use Cases

Convert between WKT and GeoJSON for:

  • Database Import/Export: Transfer spatial data between PostGIS and web apps
  • Web Mapping: Convert WKT from databases to GeoJSON for visualization
  • Data Migration: Move data between different GIS systems
  • API Integration: Transform geometry formats for different services
  • Validation: Check geometry validity in both formats

Supported Geometry Types

This converter supports all standard geometry types:

  • Point, MultiPoint
  • LineString, MultiLineString
  • Polygon, MultiPolygon
  • GeometryCollection

Both 2D and 3D coordinates are supported. The converter automatically handles coordinate transformations and validates geometry structure.

Frequently Asked Questions

WKT (Well-Known Text) is a text-based geometry format defined by OGC Simple Features. A geometry like POINT(-122.4194 37.7749) or POLYGON((0 0, 0 1, 1 1, 1 0, 0 0)) is concise and human-readable, which makes WKT popular in SQL databases (PostGIS, SQL Server, Oracle Spatial), data exchange between desktop GIS, and as a copy-paste format. GeoJSON is JSON-native and the de-facto standard for web maps. Converting between them lets you query in PostGIS, export the result as WKT, and visualise it in a Leaflet or Mapbox map without writing a custom parser. The conversion is lossless for all standard geometry types.

All standard OGC types: POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, and GEOMETRYCOLLECTION, in both directions. On the GeoJSON side it also reads a full Feature or FeatureCollection, not just a bare geometry object, so you can paste exports from QGIS, geojson.io, ogr2ogr or PostGIS ST_AsGeoJSON straight in. A Z (elevation) third coordinate is preserved per RFC 7946; an M (measure) value is not part of GeoJSON and is dropped on conversion, so keep a copy of the original WKT if you rely on M.

GeoJSON requires WGS84 longitude-latitude (EPSG:4326) per RFC 7946. WKT does not embed CRS information in the text itself; that is stored externally (in PostGIS's geometry_columns table or as a separate srid value). When converting from WKT to GeoJSON, you should be confident that the source WKT is already in WGS84, otherwise reproject first using ST_Transform in PostGIS or ogr2ogr. The tool does not reproject and does not auto-detect a projected CRS from coordinate magnitudes, so large UTM-style numbers will pass through unchanged; check that values fall in the latitude-longitude range before trusting the output on a map.

Yes. EWKT prefixes the geometry with SRID=xxxx; followed by the standard WKT, exactly as PostGIS ST_AsEWKT() emits it. The converter recognises this prefix and strips the SRID before parsing, so you can paste a PostGIS query result directly. Note that the tool does not reproject: the coordinates are accepted as-is regardless of the SRID value. If the SRID is not 4326 (for example a national grid or Web Mercator EPSG:3857), reproject upstream with ST_Transform first, because converting between datums in the browser would require a heavy library (proj4js with EPSG bundles) that this lightweight tool does not bundle.

Yes. You can paste either WKT or GeoJSON and it will detect the format and offer the conversion in the opposite direction. GeoJSON to WKT is useful for inserting geometries into PostgreSQL/PostGIS using ST_GeomFromText() or for sharing geometries with desktop GIS tools that accept WKT (QGIS's Field Calculator, ArcGIS Pro's Calculate Geometry). When converting a GeoJSON FeatureCollection to WKT, you can choose to output a list of WKT strings (one per feature) or a single GEOMETRYCOLLECTION containing them all. Properties are dropped because WKT has no concept of attached attributes.

WKT typically stores coordinates as decimal numbers with up to 15 significant digits, which matches the precision of IEEE 754 double-precision floats used in JavaScript. The conversion preserves the full precision both ways. However, if you copy a WKT geometry from PostgreSQL, the database may have rounded coordinates to a fixed precision (often 7 decimal places, about 1 cm at the equator) before storage. Downstream rounding by JSON serialisation in JavaScript can also remove trailing zeros, although the numeric value is preserved. For audit-grade exact preservation, check both source and target tooling rounding configurations.

Polygon is a single closed shape with one outer ring and zero or more inner rings (holes). MultiPolygon is a list of independent Polygons that should be treated as a single feature, such as a country composed of islands. WKT distinguishes them with the keywords POLYGON((...)) and MULTIPOLYGON(((...)),((...))). The converter preserves this distinction in GeoJSON output. Some renderers will display a Polygon and a MultiPolygon identically, but spatial operations behave differently: ST_Area on a MultiPolygon sums all parts; ST_Intersects with a hole-containing Polygon correctly excludes the hole, while a naive Multi-of-Polygons may not.

Yes, after the first visit. The converter is pure client-side JavaScript with no network dependency; once the page is in your browser cache, it works offline indefinitely. There are no cookies or analytics installed on the geometry data, no uploads happen during conversion, and you can verify this by watching the browser's network tab while you paste and convert. This matters when working with confidential geometries such as proprietary survey results, internal facility layouts, or location data subject to GDPR or other privacy regulations. Closing the tab discards everything from memory.

It no longer fails. Almost every real-world GeoJSON file is a FeatureCollection (QGIS Save As GeoJSON, geojson.io, ogr2ogr, ArcGIS, and PostGIS rows wrapped with json_build_object all emit one), and the tool now reads FeatureCollection, single Feature and GeometryCollection inputs directly, not just a bare {type, coordinates} geometry. For the GeoJSON to WKT direction, pick how you want the result: choose One WKT per line to get a separate WKT string for each feature (handy for an INSERT loop), or Single GEOMETRYCOLLECTION to wrap every geometry into one GEOMETRYCOLLECTION(...). Feature properties are dropped because WKT carries geometry only.

GeoJSON uses longitude, latitude order (X then Y) per RFC 7946, which is the opposite of the lat, lng order many web maps and APIs accept, so POINT(105.83 21.03) becomes [105.83, 21.03]. This lon-lat swap is the single most common reason a converted point lands in the wrong hemisphere; if your geometry appears off the coast of West Africa near 0,0 it is usually a swapped pair. RFC 7946 also recommends the right-hand rule for Polygon rings: exterior rings counter-clockwise, holes clockwise. The tool passes coordinates through unchanged and does not silently rewind rings, so if a strict consumer rejects your polygon, fix the winding order at the source (ST_ForcePolygonCCW in PostGIS, or rewind in QGIS).
WKT GeoJSON Converter - Convert WKT to GeoJSON Online — Free WKT GeoJSON converter: convert WKT, EWKT and PostGIS output to/from GeoJSON FeatureCollection in WGS84. Validate an
WKT GeoJSON Converter - Convert WKT to GeoJSON Online