KML to WKB Converter

When features digitised in Google Earth need to land in a spatial database's geometry column as compact binary rather than verbose XML.

Convert KML to WKB now

Common issues converting KML to WKB

Frequently asked questions

Is the output EWKB or plain OGC WKB?

Plain OGC WKB, little-endian (the first byte of each record is 0x01). For PostGIS's EWKB form with an embedded SRID, call ST_SetSRID(ST_GeomFromWKB($1), 4326) at INSERT time.

Do placemark names and attributes survive?

No — WKB is a geometry-only encoding with no attribute layer. To keep names, descriptions, or ExtendedData, run KML→CSV in parallel and join the two by row index.

How do I load the result into PostGIS?

Pass each record through ST_GeomFromWKB in a prepared statement, or hex-encode and COPY into a bytea column then convert. The output here is raw binary; encode-to-hex if your tooling expects hex strings.

Is altitude preserved?

Yes. KML coordinates with an altitude triplet produce WKB records with the OGC Z-modifier (POINT Z, LINESTRING Z, etc.). 2D placemarks produce plain 2D geometry.

Related conversions

Tools & reference