GeoJSON ↔ WKT Converter
Convert between GeoJSON and WKT (Well-Known Text) formats. Essential for PostGIS, QGIS, and spatial database workflows.
Conversion Direction
Input GeoJSON
or drag & drop
What is WKT?
Well-Known Text (WKT) is a text markup language for representing vector geometry objects. It's widely used in:
- PostGIS — PostgreSQL spatial extension
- QGIS — Desktop GIS application
- Spatial databases — Oracle Spatial, SQL Server, etc.
- OGC standards — Open Geospatial Consortium formats
How to Use
GeoJSON → WKT
- Select "GeoJSON → WKT" conversion mode
- Paste or drag your GeoJSON file
- Copy WKT output for use in PostGIS queries or QGIS
WKT → GeoJSON
- Select "WKT → GeoJSON" conversion mode
- Paste WKT text (POINT, LINESTRING, POLYGON, etc.)
- Download GeoJSON or preview on map
Features
✓ Bidirectional conversion — GeoJSON ↔ WKT in both directions ✓ All geometry types — Point, LineString, Polygon, Multi*, GeometryCollection ✓ Instant preview — See results on interactive map ✓ PostGIS ready — Copy WKT directly into SQL queries ✓ Batch support — Convert multiple features at once ✓ EWKT support — Extended WKT with SRID (e.g., SRID=4326;POINT(...))
Use Cases
🗄️ Import to PostGIS — Convert GeoJSON to WKT for SQL INSERT statements 🗺️ Export from QGIS — Convert WKT to GeoJSON for web mapping 🔍 Spatial queries — Use WKT in ST_GeomFromText() functions 📊 Data migration — Transfer geometries between different GIS systems 🧪 Testing — Quickly convert geometries for spatial analysis
WKT Format Examples
Point
POINT(30 10)LineString
LINESTRING(30 10, 10 30, 40 40)Polygon
POLYGON((30 10, 40 40, 20 40, 10 20, 30 10))Polygon with Hole
POLYGON((35 10, 45 45, 15 40, 10 20, 35 10),
(20 30, 35 35, 30 20, 20 30))MultiPoint
MULTIPOINT((10 40), (40 30), (20 20), (30 10))Extended WKT (EWKT)
SRID=4326;POINT(-122.4194 37.7749)PostGIS Integration
Insert GeoJSON as WKT
sql
INSERT INTO cities (name, geom)
VALUES ('San Francisco',
ST_GeomFromText('POINT(-122.4194 37.7749)', 4326)
);Query WKT from PostGIS
sql
SELECT name, ST_AsText(geom) as wkt
FROM cities
WHERE ST_DWithin(geom, ST_MakePoint(-122.4, 37.7), 0.1);Tips
💡 Always specify SRID when using WKT in PostGIS (usually 4326 for GPS coordinates) 💡 Use EWKT format for coordinate system preservation 💡 Validate WKT before inserting into databases to avoid errors 💡 Check coordinate order — WKT uses (X Y) = (Longitude Latitude) 💡 Mind the precision — Too many decimals can slow down spatial queries
Related Tools
- GeoJSON ↔ TopoJSON — Convert to/from TopoJSON
- Shapefile → GeoJSON — Convert Shapefiles
- CRS Converter — Transform coordinate systems
- GeoJSON Minifier — Reduce file size
Technical Details
Supported Geometry Types
- Point, MultiPoint
- LineString, MultiLineString
- Polygon, MultiPolygon
- GeometryCollection
Coordinate Systems
- WGS84 (EPSG:4326) — Default
- EWKT with SRID support for other coordinate systems
Input Formats
- GeoJSON: Feature, FeatureCollection, Geometry
- WKT: Standard OGC WKT format
- EWKT: Extended WKT with SRID prefix
Output Formats
- WKT: Clean OGC-compliant text
- EWKT: With SRID prefix (optional)
- GeoJSON: Standard RFC 7946 format
Frequently Asked Questions
Q: What's the difference between WKT and EWKT? A: EWKT (Extended WKT) includes SRID prefix for coordinate system, e.g., SRID=4326;POINT(...). Standard WKT has no SRID.
Q: Can I convert 3D geometries (with Z coordinates)? A: Yes, both WKT and EWKT support Z coordinates, e.g., POINT Z (30 10 5).
Q: Does this work with PostGIS 3.x? A: Yes, the WKT format is compatible with all PostGIS versions.
Q: Can I convert large datasets? A: Yes, but for very large files (>100MB), consider using GDAL/OGR command-line tools.
Q: What's the coordinate order in WKT? A: WKT uses (X Y) = (Longitude Latitude), same as GeoJSON.
Q: Can I use this with Oracle Spatial? A: Yes, Oracle Spatial also uses WKT format via SDO_GEOMETRY.
Q: How do I add SRID to WKT output? A: Enable "EWKT format" option to include SRID prefix in output.