H3 Viewer — visualize H3 hexagons and resolutions
See Uber's H3 hexagonal grid on a real map. Pan and zoom to draw hexagons at any resolution from 0 to 15, tap a cell to read its H3 index, and share the exact view with a link. It all runs in your browser — no coordinates leave your machine.
What H3 is
H3 is a hexagonal hierarchical geospatial index open-sourced by Uber. It lays a grid of hexagons over the globe at 16 resolutions (0–15), where each step refines every cell into roughly seven finer ones. Because the grid is built on an icosahedron rather than a flat projection, H3 cells stay close to uniform in size and shape anywhere on Earth — a property that plain latitude/longitude grids lose badly near the poles.
One consequence of tiling a sphere with hexagons: it cannot be done with hexagons alone. Every resolution therefore contains exactly 12 pentagon cells, one at each vertex of the underlying icosahedron. H3 positions them over ocean so most workloads never touch one, but a pentagon has 5 neighbours instead of 6, so code that assumes six neighbours should guard against it.
Why hexagons
The reason H3 chose hexagons is neighbour uniformity. In a hexagon grid, all six neighbours share a full edge and lie the same distance from the cell centre. Square grids do not have that: a square's edge-neighbours and corner-neighbours are at different distances, so any calculation involving movement, spread, or a radius is subtly biased by the grid itself. For ride-hail dispatch, delivery coverage, traffic and flow modelling, and smoothing point data into a surface, that even spacing makes hexagons the natural cell.
H3 resolution → average edge length
Unlike rectangular grids, H3 cells are close to uniform, so a single average edge length per resolution is a fair guide. The values below are the published average hexagon edge lengths from the H3 library (they vary slightly cell to cell); use them to pick a resolution, not for exact geometry.
| Resolution | Avg edge length (approx) | Rough scale |
|---|---|---|
| 0 | ~1,281 km | continental |
| 5 | ~9.9 km | a town / region |
| 7 | ~1.4 km | a district |
| 9 | ~201 m | a city block |
| 11 | ~28.6 m | a building footprint |
| 13 | ~4.1 m | a parking space |
| 15 | ~0.6 m | sub-metre (finest) |
H3 in code (h3-js quickstart)
The two calls you use constantly are latLngToCell (point → H3 index) and
cellToBoundary (index → the hexagon's ring of vertices, for drawing). Note H3
takes coordinates as latitude, longitude — the opposite order from GeoJSON.
Point → H3 index → boundary with h3-js
import { latLngToCell, cellToBoundary, getResolution } from 'h3-js';
// point → H3 index (note: lat, lng order)
const idx = latLngToCell(37.77, -122.42, 9); // "89283082813ffff"
getResolution(idx); // 9
// index → polygon boundary as [lat, lng] pairs
const ring = cellToBoundary(idx);
// → [[37.7688, -122.4168], … 6 vertices …] Need to convert an H3 index to WKT or GeoJSON, or check one you were handed? Paste the index into the universal geometry inspector — it recognises H3, draws the cell, and re-exports it in any supported format.