MapTools
file convertersFree · No signup

Well-Known Text (WKT) to GeoJSON & Map Visualizer

Parse, validate, and visualize OGC Well-Known Text (WKT) geometries (POINT, LINESTRING, POLYGON, MULTIPOLYGON) and convert them to GeoJSON.

From:
To:
Input (CSV)Paste or edit code
Output Result (GEOJSON)

Runs entirely in your browser — your inputs never leave this page.

How this tool works

  1. 1

    Tokenizes OGC standard WKT geometric string syntax and maps coordinate pairs into nested GeoJSON arrays.

Common uses

  • Debugging SQL/PostGIS spatial query outputs
  • Validating spatial database dumps
  • Converting CAD WKT strings for web display

Frequently asked questions

Yes! POINT Z, LINESTRING Z, and POLYGON Z dimensional coordinates are parsed and visualized.

More in File Converters

View all →
Worked example

Visualizing a Berlin Courier Zone Copied Out of a Database

A developer in Berlin is debugging a courier app. The database stores its delivery zone as Well-Known Text, and support keeps asking why a certain address is rejected. He copies the WKT string for the pickup point near Alexanderplatz straight from the query results: POINT(13.405 52.52). He pastes it into the tool and it converts to a GeoJSON Point with coordinates [13.405, 52.52], plotted on the map in central Berlin, right where the shop is. WKT writes the longitude first and the latitude second, separated by a space, which matches GeoJSON's order, so a correct database point should land correctly.

Next he checks the delivery zone itself, stored as a POLYGON with five coordinate pairs. The ring starts at (13.40 52.515) and, as WKT requires, the fifth pair repeats the first exactly, closing the ring. The converted polygon draws a tidy block-sized zone on the map, and the rejected address turns out to sit one street outside its eastern edge, which explains the support tickets. To be thorough he also pastes a LINESTRING of three points representing the courier's usual run from the shop to two drop-off lockers. It converts cleanly and draws the route across the same streets the rider actually uses, which confirms the geometry columns in the database are healthy and the bug lives in the app logic, not the data.

He exports the zone as GeoJSON and drops it into the team's test page, where the same file draws the boundary for the testers. A string that was unreadable in a database table is now a picture everyone on the team can point at. As a final exercise he writes one tiny polygon by hand to prove he understands the syntax: a rough square around the shop with corners at (13.404 52.519), (13.406 52.519), (13.406 52.521), and (13.404 52.521), then the first pair repeated to close it. At Berlin's latitude, 0.002 degrees of longitude is about 445 feet and 0.002 degrees of latitude about 729 feet, so his test square covers a believable block. It converts and draws on the first try, which is the moment the format stops feeling like alphabet soup.

He saves the three tested strings, the point, the zone polygon, and the route line, into the team wiki with screenshots from the map. When the courier company expands across the river into a second district, the zone column starts returning MULTIPOLYGON text with two separate rings, and he pastes one into the tool as a final check. It converts and draws both patches in the right neighborhoods, so the support team can keep using the same visual debugging habit as the data grows more complex.

Common mistakes to avoid

  • Putting a comma between x and y. Inside a WKT coordinate pair the two numbers are separated by a space, not a comma; commas separate one pair from the next. POINT(13.405, 52.52) will not parse.
  • Leaving the polygon ring unclosed. A WKT POLYGON ring must repeat its first pair as its last. Without that exact repeat, the geometry is invalid even if it looks fine in the text.
  • Pasting the SRID prefix along with the geometry. Databases often return EWKT such as SRID=4326;POINT(13.405 52.52). Remove everything before the geometry keyword or the parser will reject the string.

Pro tips

  • Read POINT(x y) as POINT(longitude latitude); for Berlin that means the 13 comes before the 52.
  • Count polygon pairs as a quick check: a valid ring has at least four pairs, with the first and last identical.
  • Convert and view the result on the map before using it in code; a point in the Gulf of Aden means the pair order got flipped somewhere.
Geospatial Engineering Reference & Field Manual

GIS Files & Interoperability: Speaking Every Map Format

GeoJSON, KML, GPX, Shapefiles — what each format is for, how to convert between them without losing data, and how to fix the files that refuse to open. Written for Well-Known Text (WKT) to GeoJSON & Map Visualizer and the everyday mapping tasks around it.

1

Vector vs. Raster: The Two Tribes

Every map file belongs to one of two families. Vector formats store geometry as math: points with coordinates, lines as point sequences, polygons as closed rings. They scale forever, stay tiny, and carry attributes like names and populations. GeoJSON, KML, and Shapefiles are all vector.

Raster formats store grids of cells, like digital photos. Satellite imagery, scanned paper maps, and elevation models are raster. They capture continuous reality beautifully but balloon in size and pixelate when zoomed. GeoTIFF is the GIS world's raster workhorse.

Choose vector when your data is discrete things — stores, boundaries, routes. Choose raster when it is continuous — imagery, terrain, temperature surfaces. Converting vector to raster is easy (just draw it); going the other way needs tracing, by hand or with image-processing algorithms.

2

GeoJSON: The Web's Native Tongue

GeoJSON is a map format written as JSON, the same notation web developers use for data. A point looks like this — readable by humans and parseable by every browser with zero libraries. That simplicity made it the default for web maps.

{"type": "Point", "coordinates": [-74.006, 40.7128]}

Its structure is small but complete: Feature objects pair geometry with a properties dictionary, and FeatureCollections bundle many features into one file. The properties can hold anything — names, dates, measurements — which makes GeoJSON a fine carrier for analysis results, not just shapes.

GeoJSON has quirks to respect. Coordinates are always longitude-first, which trips up everyone once. It officially supports only the WGS84 datum, so reproject anything else before exporting. And it has no built-in styling — colors and icons live in a separate layer of your application, not in the file.

For big data, look at its cousins: newline-delimited GeoJSON streams features one per line for huge datasets, and FlatGeobuf packs the same model into a fast binary format. But for files under a few megabytes, plain GeoJSON remains unbeatable for simplicity.

This page shows the first two chapters. Read the complete this category field guide →