WKT Viewer

Paste a Well-Known Text (WKT) geometry and see it drawn instead of decoding nested parentheses by eye. POINT, LINESTRING, POLYGON, every MULTI variant, and a nested GEOMETRYCOLLECTION are all parsed and rendered, with a structure breakdown showing each part and its coordinate count. The drawing uses a plain X/Y projection and assumes no coordinate system, so projected and geographic geometry both display, and everything is parsed in your browser with nothing uploaded.

How to use the WKT Viewer

Paste a single WKT geometry into the box. The parser recognises the seven standard types — POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, and GEOMETRYCOLLECTION — in any mix of upper and lower case. It also accepts the Z, M, and ZM dimensionality tags that mark 3D and measured coordinates, reading the X and Y of each position and ignoring any extra Z or M values for the drawing. An EMPTY geometry is parsed without error and reported as having nothing to draw.

The geometry is drawn onto a compact frame, fitted to its bounding box. Points become dots, line strings become strokes, and polygons become filled outlines with any inner rings cut out as holes. Because WKT does not record which coordinate system it uses, the viewer makes no projection assumption: it plots X horizontally and Y vertically exactly as written, which is correct for both longitude/latitude pairs and projected easting/northing. The bounds line reports the raw X and Y ranges so you can tell at a glance whether the numbers look like degrees or metres.

Below the drawing, a structure breakdown lists the geometry type and, for a collection, each child geometry indented beneath it, with the coordinate count for each part. That makes it easy to confirm that a MULTIPOLYGON has the number of rings you expect or that a GEOMETRYCOLLECTION holds the right mix of shapes. If the text cannot be parsed, the error names the kind of token expected and the position where parsing stopped, so a missing parenthesis or an extra comma is quick to find.

What Well-Known Text is and where it is used

Well-Known Text is a human-readable markup for vector geometry, defined by the Open Geospatial Consortium as part of its Simple Features standard and mirrored in the ISO/IEC 13249 SQL spatial standard. Its companion is Well-Known Binary (WKB), the compact byte encoding of the same model; WKT is what you read and type, WKB is what databases store and transmit. Together they are the common currency for moving geometry between spatial databases, GIS tools, and libraries.

The grammar is small and regular. A geometry is a type keyword followed by coordinates wrapped in parentheses: POINT (30 10) is one position, LINESTRING (30 10, 10 30, 40 40) is a path, and POLYGON ((…)) is a ring, with a polygon's first ring being the exterior boundary and any further rings being holes. The plural types group several of these: a MULTIPOLYGON nests one more level of parentheses so it can hold several polygons, and a GEOMETRYCOLLECTION can contain any mixture of geometries, each written in full. Coordinates within a position are separated by spaces and positions by commas, which is the opposite of GeoJSON's comma-and-bracket convention, and a frequent source of confusion when converting between the two.

WKT turns up most often around databases. PostGIS, the spatial extension to PostgreSQL, accepts and emits WKT through functions such as ST_GeomFromText and ST_AsText, and the same pattern appears in SpatiaLite, SQL Server, Oracle Spatial, and MySQL. Spatial libraries like JTS, GEOS, and Shapely all read and write it too. Because it is plain text, WKT is what people paste into bug reports, copy out of a query result to check a shape, or hand-write for a quick test. The same readability that makes it convenient also makes the nested parentheses hard to picture once a polygon has a few holes or a collection mixes types, which is exactly when drawing the geometry and listing its structure saves time.

Common use cases

  • Checking a PostGIS result. Paste the WKT from an ST_AsText query to confirm the shape is what you expected.
  • Hand-writing test geometry. Verify that a polygon or collection you typed parses and looks right before using it in a test.
  • Counting parts. See how many rings or sub-geometries a MULTIPOLYGON or GEOMETRYCOLLECTION actually contains.
  • Catching syntax slips. Find the missing parenthesis or stray comma that makes a WKT string fail to parse.

Frequently asked questions

Which WKT types are supported?

All seven standard types: POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, and GEOMETRYCOLLECTION, plus the EMPTY keyword. Both MULTIPOINT spellings — bare and parenthesised points — are accepted.

Does it handle 3D (Z) or measured (M) coordinates?

Yes. The Z, M, and ZM dimensionality tags are recognised, and the X and Y of each position are used for drawing. Extra Z or M values are read and ignored so the geometry still renders.

Why is there no map background?

WKT does not record a coordinate reference system, so the viewer cannot know where on Earth the geometry sits. It plots X and Y exactly as written against a plain frame, which works for both projected and geographic coordinates.

What is the difference between WKT and WKB?

They encode the same geometry model. WKT is the readable text form you paste here; WKB is the compact binary form databases store and transmit. This viewer reads the text form.

Is my geometry uploaded anywhere?

No. Parsing and drawing happen entirely in your browser. The WKT you paste never leaves your device.