Encoded Polyline Converter
Convert between Google's encoded polyline format and GeoJSON/WKT.
How to use
- Polyline → GeoJSON: paste a Google-encoded polyline string to decode it.
- GeoJSON → Polyline: paste a LineString to encode it, choosing precision 5 (Google default) or 6 (OSRM/Valhalla).
Map Preview
Bidirectional Encoded Polyline Conversion
Convert between Google encoded polylines and GeoJSON LineStrings. Choose precision 5 or precision 6 as used by OSRM and Valhalla.
An encoded polyline is far more compact than GeoJSON, which is why routing APIs use it to transmit route data. Matching the precision — 5 or 6 — to the routing service that produced the string is what determines whether the decoded coordinates come out correct.
How to use it
- Enter an encoded polyline string, or a GeoJSON LineString.
- Choose the precision — 5 or 6.
- Check the converted route on the map.
Frequently asked questions
Why does my decoded route look totally wrong?
Almost always a precision mismatch — OSRM and Valhalla use precision 6, not Google's default of 5. Matching the source's precision usually fixes it.
How was correctness verified?
Matched byte-for-byte against Google's own published encoded-polyline-algorithm example.