Skip to content
Geo Utilities

Encoded Polyline Converter

Convert between Google's encoded polyline format and GeoJSON/WKT.

How to use
  1. Polyline → GeoJSON: paste a Google-encoded polyline string to decode it.
  2. GeoJSON → Polyline: paste a LineString to encode it, choosing precision 5 (Google default) or 6 (OSRM/Valhalla).

Map Preview

Loading map…

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

  1. Enter an encoded polyline string, or a GeoJSON LineString.
  2. Choose the precision — 5 or 6.
  3. 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.

Report an issue