AI Tools Free

WKB to WKT Converter

Decode hexadecimal OGC Well-Known Binary (`WKB`) and PostGIS Extended WKB (`EWKB` with embedded `SRID`) strings into human-readable Well-Known Text (`WKT` / `EWKT`), with full byte-order (`NDR`/`XDR`), dimensionality (`2D`/`Z`/`M`/`ZM`), vertex count, and bounding box inspection.

Free to useNo sign-upRuns in your browser
Enter your details

Enter the inputs, then select Decode WKB to WKT.

Choose whether to include the PostGIS SRID=xxxx; prefix when decoding EWKB geometries.

Maximum decimal places for IEEE 754 float64 coordinates (trailing zeros are trimmed cleanly).

Paste a hex-encoded WKB or EWKB string (optional 0x prefix; supports 01 little-endian and 00 big-endian).

Your result
Enter your details

Result will appear here

How the WKB / EWKB Hex Decoder Works

Paste a raw hex string from `ST_AsBinary`, `ST_AsEWKB`, a GeoPackage blob, or a PostGIS table dump (`0101000020E6100000...`).

Byte 0: Endianness (01=NDR Little-Endian, 00=XDR Big-Endian); UInt32 TypeWord: BaseType (1..6), Z=0x80000000, M=0x40000000, SRID=0x20000000; Coords: IEEE 754 float64 (8 bytes/axis).

Decodes standard OGC WKB (ISO/IEC 13249-3) and PostGIS EWKB (SRID flag 0x20000000) across POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, and GEOMETRYCOLLECTION in both little-endian and big-endian byte orders.

WKB to WKT Converter workflow overview
Workflow overview for WKB to WKT Converter.

OGC WKB & PostGIS EWKB Binary Header Byte Layout Reference

Quick reference for decoding the byte order flag, 32-bit type word, and PostGIS SRID flag at the start of any WKB hex string.

Field / Geometry TypeLittle-Endian Hex (`01`)Big-Endian Hex (`00`)UInt32 ValueMeaning
Byte Order Flag`01``00``1` or `0``01` = Little-Endian (NDR); `00` = Big-Endian (XDR)
2D `POINT``01000000``00000001``1` (`0x01`)Standard 2D Point (`16 bytes` of X, Y follow)
2D `LINESTRING``02000000``00000002``2` (`0x02`)Point count `N` (`uint32`) + `N` X/Y pairs
2D `POLYGON``03000000``00000003``3` (`0x03`)Ring count `R` (`uint32`) + `R` linear rings
EWKB `POINT` + SRID`01000020``20000001``0x20000001`PostGIS Point followed by 4-byte SRID (e.g. `E6100000` = `4326`)
ISO `POINT Z``E9030000``000003E9``1001`ISO SQL/MM 3D Point (`X, Y, Z` = `24 bytes`)

How to use WKB to WKT Converter step by step

Enter the values for your scenario, verify the units, and run the calculation.

Enter the inputs

Start by entering the required fields in the WKB to WKT Converter form above.

WKB to WKT Converter step 1: Enter the inputs
Step 1 workflow overview for WKB to WKT Converter.

Verify units and assumptions

Match each value to the unit or format shown next to the input box before running the calculation.

WKB to WKT Converter step 2: Verify units and assumptions
Step 2 workflow overview for WKB to WKT Converter.

Run and export your result

Select Decode WKB to WKT, inspect the primary metric and breakdown cards, then use Copy result or Download result.txt.

WKB to WKT Converter step 3: Run and export your result
Step 3 workflow overview for WKB to WKT Converter.

Worked examples for WKB to WKT Converter

Compare baseline and alternative runs for WKB to WKT Converter before exporting the result.

Baseline example

Convert hexadecimal OGC Well-Known Binary (WKB) and PostGIS EWKB geometry strings into readable Well-Known Text (WKT / EWKT), supporting POINT, LINESTRING, POLYGON, MULTI*, Z/M, and SRID.

WKB to WKT Converter example 1: Baseline example
Worked example 1 for WKB to WKT Converter.

Comparison scenario

Byte 0: Endianness (01=NDR Little-Endian, 00=XDR Big-Endian); UInt32 TypeWord: BaseType (1..6), Z=0x80000000, M=0x40000000, SRID=0x20000000; Coords: IEEE 754 float64 (8 bytes/axis).

WKB to WKT Converter example 2: Comparison scenario
Worked example 2 for WKB to WKT Converter.

Boundary check before exporting

Decodes standard OGC WKB (ISO/IEC 13249-3) and PostGIS EWKB (SRID flag 0x20000000) across POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, and GEOMETRYCOLLECTION in both little-endian and big-endian byte orders.

WKB to WKT Converter example 3: Boundary check before exporting
Worked example 3 for WKB to WKT Converter.

How to interpret the WKB to WKT Converter output

Review the calculated output alongside your entered parameters and unit conventions.

Decodes standard OGC WKB (ISO/IEC 13249-3) and PostGIS EWKB (SRID flag 0x20000000) across POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, and GEOMETRYCOLLECTION in both little-endian and big-endian byte orders.

How to interpret WKB to WKT Converter results
Result interpretation guide for WKB to WKT Converter.

Binary Geometry Validation Checklist

Keep these three binary rules in mind when troubleshooting WKB strings.

Byte 0: Endianness (01=NDR Little-Endian, 00=XDR Big-Endian); UInt32 TypeWord: BaseType (1..6), Z=0x80000000, M=0x40000000, SRID=0x20000000; Coords: IEEE 754 float64 (8 bytes/axis). Decodes standard OGC WKB (ISO/IEC 13249-3) and PostGIS EWKB (SRID flag 0x20000000) across POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, and GEOMETRYCOLLECTION in both little-endian and big-endian byte orders.

Scope limits and assumptions for WKB to WKT Converter
Assumptions and input boundaries for WKB to WKT Converter.

WKB to WKT Converter: common questions

Answers about using WKB to WKT Converter and understanding its results.

What is the difference between OGC WKB and PostGIS EWKB?

Standard OGC Well-Known Binary (WKB) encodes byte order, a 32-bit geometry type code (e.g. 1 for Point, 2 for LineString, 3 for Polygon), and IEEE 754 64-bit floating-point coordinates, but does not embed a coordinate reference system (SRID). PostGIS Extended WKB (EWKB) sets bit flag 0x20000000 in the type word (e.g. 0x20000001) and inserts a 4-byte integer SRID (such as 4326 for WGS 84, 0xE6100000 in little-endian) immediately after the type word.

How do I read the first 5 bytes of a WKB hex string?

The first byte (2 hex characters) is the endianness flag: 01 means little-endian (NDR, least significant byte first) and 00 means big-endian (XDR). The next 4 bytes (8 hex characters) form the 32-bit geometry type word. In little-endian, 01000000 is uint32 1 (POINT), 02000000 is 2 (LINESTRING), 03000000 is 3 (POLYGON), and 01000020 is 0x20000001 (POINT with EWKB SRID).

How are coordinates stored inside WKB?

Every coordinate axis value (X, Y, and optional Z or M) is stored as an 8-byte (64-bit) IEEE 754 double-precision float (16 hex characters per number, 32 hex characters per 2D X/Y vertex).

What happens if a WKB Point contains NaN coordinates?

In OGC WKB and PostGIS, an empty point (`POINT EMPTY`) is represented in binary WKB as a Point whose X and Y IEEE 754 float64 values are `NaN` (`0x7FF8000000000000`). This decoder detects `NaN` coordinates and outputs standard `POINT EMPTY`.

Try your own values

Choose another tool for your next calculation, conversion, or text task.

Decode WKB to WKT