S2 cell tools

Encode and decode S2 indexes, explore cells on a map, cover shapes and convert spatial data.

Decode
Convert an S2 cell to coordinates, check its GeoJSON or WKT representation, visualize it in a map and much more
Encode
Convert a pair of latitude, longitude coordinates to its S2 cell representation at any precision
Draw
Bring your CSV S2-encoded data to visualize it on a map
Aggregate
Bring your coordinate-encoded CSV dataset to aggregate it by S2 cells
Browse
Explore a world of S2 cells in a moving map
Inside
Find the list of S2 cells inside a GeoJSON or WKT
Near
Get a list of S2 cells near a coordinate, inside a radius
Between
Get a list of S2 cells between two coordinates
Along
Get the S2 cells along a LineString or MultiLineString
Neighbors
Get a list of S2 neighbors
Format
Format S2 cells into other geometry representations for your CSVs
Compress
Compress a list of S2 cells using the best combination across various resolutions

What is S2?

S2 divides the Earth into a hierarchy of quadrilateral cells, using six cube faces projected onto a sphere.

Developed at Google, S2 uses 64-bit cell identifiers and 31 levels, from 0 to 30. Hexadecimal tokens identify cells for spatial indexing, region coverings, neighbor queries and data aggregation.

Read about S2