Cell & Shape

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.

ResolutionAvg edge length (approx)Rough scale
0~1,281 kmcontinental
5~9.9 kma town / region
7~1.4 kma district
9~201 ma city block
11~28.6 ma building footprint
13~4.1 ma parking space
15~0.6 msub-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.

Frequently asked questions

What H3 resolution should I use?
Match the resolution to the phenomenon you are aggregating. Resolution 5 (~9 km hexagons) suits regional heatmaps; resolution 7 (~1.4 km) suits city-level demand or coverage; resolution 9 (~200 m) suits street-level movement and pickups; resolution 11 (~29 m) suits building-scale detail. Pick the coarsest resolution that still separates the things you need to tell apart — finer resolutions multiply cell counts roughly sevenfold each step.
Why does my H3 grid have a pentagon in it?
H3 is built on an icosahedron (a 20-faced solid), and closing a sphere with hexagons is mathematically impossible — you always need exactly 12 pentagons, one at each icosahedron vertex. So every resolution has 12 pentagon cells; the rest are hexagons. The pentagons sit over the oceans by design to keep them away from populated land, but if your data spans one you should handle it specially, because a pentagon has 5 neighbours instead of 6.
H3 vs geohash — what is the difference?
Geohash tiles the world with latitude/longitude rectangles addressed by a base-32 string; its prefix property makes proximity queries easy but its cells distort badly toward the poles and its 8 neighbours sit at unequal distances. H3 uses hexagons of near-uniform size and shape whose 6 neighbours are equidistant, which is far better for movement and flow analytics — at the cost of no simple string-prefix hierarchy.
Why hexagons instead of squares?
In a hexagon grid every neighbour shares an edge and sits the same distance from the centre, so there is no ambiguous "diagonal" step. Square grids have two neighbour distances (edge and corner), which biases any analysis of movement, diffusion, or radius. That single uniform-neighbour property is why H3 is popular for ride-hail, delivery, and flow modelling.
Is an H3 index a number I can store as an integer?
An H3 index is a 64-bit value, usually written as a 15-character hex string such as "89283082813ffff". The h3-js library uses those strings, which sidesteps the 2^53 integer-precision limit that bites other 64-bit ID schemes in JavaScript. Store the string, or a native 64-bit integer / BigInt — not a plain JavaScript number.