What is a WKB viewer?
Well-Known Binary (WKB) is the compact binary form of a geometry: a point, a line, a polygon or a group of them. It is defined in the OGC Simple Features standard, together with its readable sister format WKT (Well-Known Text). Databases and libraries use WKB to store and move geometry, because numbers stay exact and take little space.
The problem is that people cannot read it. A query in PostGIS returns a long line like 0101000020E6100000..., and you cannot tell whether it is a point in Berlin, a polygon in the wrong place or a damaged value. This WKB viewer decodes that line in your browser, draws it on a map and shows the type, the coordinate system (SRID), the byte order, the number of vertices and the extent.
My advice: when a geometry looks wrong, look at the bytes before you blame your map. The byte table in this tool names each field, so you can see at once if the SRID is missing, if latitude and longitude are swapped, or if the value was cut off while copying.
How WKB is built: a point, byte by byte
Here is POINT (2 4) in little-endian WKB. The whole value is 010100000000000000000000400000000000001040: 21 bytes, written as 42 hexadecimal characters.
| Bytes (hex) | Meaning |
|---|---|
| 01 | Byte order, 1 byte. 01 means little-endian (least significant byte first), 00 means big-endian. |
| 01000000 | Geometry type, 4 byte integer. Read backwards in little-endian, this is 1: a point. |
| 0000000000000040 | X (longitude), 8 byte IEEE 754 floating point number: 2.0 |
| 0000000000001040 | Y (latitude), 8 byte floating point number: 4.0 |
PostGIS writes the same point with its coordinate system as 0101000020E610000000000000000000400000000000001040. The type field is now 01000020: the number 1 with the flag 0x20000000, which says that a SRID follows. The next 4 bytes, E6100000, are the number 4326.
In big-endian the same point is 000000000140000000000000004010000000000000. Lines add a 4 byte point count before the coordinates. Polygons add a ring count and then a point count for each ring. In multi geometries every member is a complete WKB value with its own byte order and type.
WKB geometry type codes
The type code tells the decoder what follows. The ISO standard adds 1000 for geometries with Z (height), 2000 for M (measure) and 3000 for both.
| Geometry type | 2D | Z | M | ZM |
|---|---|---|---|---|
| Point | 1 | 1001 | 2001 | 3001 |
| LineString | 2 | 1002 | 2002 | 3002 |
| Polygon | 3 | 1003 | 2003 | 3003 |
| MultiPoint | 4 | 1004 | 2004 | 3004 |
| MultiLineString | 5 | 1005 | 2005 | 3005 |
| MultiPolygon | 6 | 1006 | 2006 | 3006 |
| GeometryCollection | 7 | 1007 | 2007 | 3007 |
| PolyhedralSurface | 15 | 1015 | 2015 | 3015 |
| TIN | 16 | 1016 | 2016 | 3016 |
| Triangle | 17 | 1017 | 2017 | 3017 |
PostGIS EWKB marks Z and M differently: it sets the flag bits 0x80000000 (Z) and 0x40000000 (M) in the type code. This viewer reads both styles. Curved types (codes 8 to 12, such as CircularString) are recognized and reported, but not drawn.
WKB, EWKB and database blobs: which one do you have?
Several formats wrap the same geometry body in a different header. The viewer recognizes each one by its first bytes.
| Format | How it starts | Coordinate system | Where it comes from |
|---|---|---|---|
| WKB (OGC / ISO) | 00 or 01, then the type code | Not stored | OGC / ISO standard, ST_AsBinary, Shapely, GEOS, GeoParquet |
| EWKB (PostGIS) | 00 or 01, type code with flag bits | Optional, inside the value | PostGIS: the text you see when you select a geometry column |
| GeoPackage blob | 47 50 (the letters GP) | In the header | GeoPackage (.gpkg) geometry columns |
| SpatiaLite blob | 00, byte order, SRID, bounding box, 7C | In the header | SpatiaLite geometry columns; ends with FE |
| MySQL internal format | 4 byte SRID, then WKB | In the first 4 bytes | MySQL and MariaDB internal geometry, for example HEX(geom) |
If you need the text form, the viewer copies every geometry as WKT, or as EWKT when it has a SRID, for example SRID=4326;POINT (13.4 52.5).
How to view WKB online, step by step
The screenshots use the built-in sample, which holds real places in Berlin written in several of these formats, plus one value that is cut off on purpose.

Paste hex into the input box, one value per line, or press "Open file" for a .wkb, .bin, .hex, .txt or .csv file. You can also drop a file on the tool. Prefixes such as 0x and \x, whole result tables and Base64 are accepted.

Press "Sample" to try it. Every value appears in the list with its type and SRID. A green check mark means it was read, an orange mark means it needs a coordinate system, and a red cross means it is damaged.

Click a geometry in the list or on the map. The details show the format, type, dimensions, SRID, byte order, size, vertex count and extent. The byte table lists each field with its position, its hex bytes and its value.

Select a value with a red cross. The viewer names the problem and the byte where it happens, for example a value that ends too early or a count that is larger than the data.

Plain WKB has no SRID. If its numbers are not longitude and latitude, type the EPSG code (for example 25833) or a PROJ string and press "Apply". Tick "Swap X and Y" when your values are written as latitude first.

Download the geometries as GeoJSON (in longitude and latitude) or as a CSV table with WKT, or copy them to the clipboard. You can also change the color, line width and fill.
How to get WKB from your database or code
Any of these sources gives you a value that you can paste straight into the viewer.
PostGIS
Selecting a geometry column in psql or pgAdmin shows EWKB hex, SRID included. ST_AsBinary(geom) returns standard WKB without the SRID, and ST_AsEWKB(geom) keeps it.
MySQL and MariaDB
HEX(geom) gives the internal format (SRID plus WKB). HEX(ST_AsBinary(geom)) gives plain WKB. In MySQL 8, ST_AsBinary writes SRID 4326 as latitude first, so add the option axis-order=long-lat or tick "Swap X and Y" here.
GeoPackage and SpatiaLite
Both are SQLite files. The query SELECT hex(geom) FROM my_table; returns the stored blob. To browse a whole file instead, use the GeoPackage Viewer or the SQLite Viewer.
Python
Shapely gives geom.wkb_hex, and shapely.from_wkb() reads it back. GeoPandas can turn a whole column into hex with to_wkb(hex=True).
Ready to copy
These commands print hex values, one per row.
-- PostGIS
SELECT geom FROM roads LIMIT 20; -- EWKB hex, with SRID
SELECT encode(ST_AsBinary(geom), 'hex') FROM roads; -- standard WKB hex
-- MySQL 8
SELECT HEX(geom) FROM places; -- SRID + WKB
SELECT HEX(ST_AsBinary(geom, 'axis-order=long-lat')) FROM places;
-- GeoPackage and SpatiaLite (SQLite)
SELECT hex(geom) FROM my_table;
# Python, Shapely 2
import shapely
print(shapely.Point(2, 4).wkb_hex)
print(shapely.from_wkb("010100000000000000000000400000000000001040"))Common WKB problems and what they mean
These are the faults I would check first when a geometry fails to load.
- The value ends too early
- The text was cut while copying. Some database tools shorten long cells, so export the result to a file or copy the full cell.
- Odd number of characters
- Each byte needs two hex characters. One character is missing or one too many was copied.
- Unknown geometry type
- The bytes are not WKB, or they have another header in front of them. Check that you selected the geometry column.
- The shape is in the wrong place
- Latitude and longitude are swapped, or the coordinates are projected and need their EPSG code.
- Nothing appears on the map
- The numbers are outside the range of longitude and latitude. Enter the coordinate system, or check the SRID.
When a WKB viewer helps
Typical jobs where seeing the geometry saves time.
- Debugging a database query. Paste the result of a spatial query and see at once whether the buffer, intersection or union returned the shape you expected.
- Checking API and log data. Services often send geometry as hex or Base64. Decode it without writing a script.
- Finding a wrong SRID. The details panel shows the stored SRID, so you can spot data that says 4326 but holds meters.
- Repairing a broken import. When one row stops an import, the byte position of the error shows whether the value was cut off or has the wrong header.
- Teaching the format. The byte table connects the standard to real numbers, which is useful in a GIS or database class.
- Sharing a result. Turn hex from a database into GeoJSON or WKT that a colleague can open in any GIS.
Frequently asked questions
1. How do I open a WKB file?
Press "Open file" and choose the file, or drop it on the tool. A binary file may hold one geometry or several WKB geometries written one after another. A text file may hold one hex or Base64 value per line.
2. What is the difference between WKB and WKT?
They describe the same geometries. WKT is text such as POINT (2 4) that people can read. WKB is binary, usually shown as hex, which computers read faster and which keeps every digit of a coordinate.
3. What is the difference between WKB and EWKB?
EWKB is the PostGIS extension of WKB. It can store a SRID and marks Z and M with flag bits. Standard WKB has no place for a SRID.
4. Can I convert WKB to GeoJSON or WKT?
Yes. "Download GeoJSON" saves the geometries in longitude and latitude, "Copy WKT" copies them as text, and the CSV download lists type, SRID and WKT for each value. GeoJSON keeps Z values and drops M values.
5. Which coordinate systems are supported?
WGS 84 and similar geographic systems, Web Mercator, UTM zones and a set of national grids by EPSG code. For any other system, type its PROJ string in the coordinate system box.
6. Is my data uploaded?
No. Your browser decodes the values on your own computer. The map downloads background tiles, but your geometry is not sent anywhere.
7. How large can the input be?
Files up to 10 MB and up to 5,000 geometries at a time. For larger tables, filter the rows in your database first, or export the table to a GeoPackage.
8. Why does my MySQL geometry appear in the wrong place?
MySQL 8 returns SRID 4326 from ST_AsBinary with latitude first. Tick "Swap X and Y", or ask MySQL for axis-order=long-lat.
9. Are curved geometries supported?
Not yet. CircularString, CompoundCurve and CurvePolygon are reported by name. In PostGIS you can turn them into straight segments with ST_CurveToLine before you copy them.
Libraries and data
The WKB decoder is written for this tool. It uses these open projects.
- Leaflet 1.9 · BSD-2-Clause · Volodymyr Agafonkin and contributorsDraws the map and the geometries.
- proj4js 2.x · MIT · Proj4js contributorsConverts projected coordinates to longitude and latitude.
- OpenStreetMap, Protomaps (hosted by KONAKTIVE), CARTO · ODbL and provider terms · OpenStreetMap contributors, Protomaps, KONAKTIVE, CARTOBasemap data and tiles.
Related tools
Datum differences below about 2 meters are ignored in coordinate conversion, so do not use the map for survey-grade work. Map tiles © OpenStreetMap contributors, drawn with Protomaps (hosted by KONAKTIVE), with CARTO as the fallback.

Comments
Questions, tips or feedback about this tool? Share them below. Every comment is checked before it appears.
Leave a comment