IT lexicon › Programming › Morton code

Morton code

Programming På svenska → Updated: 2026-10-25

A way to fold multidimensional coordinates into a single number by interleaving the bits of each axis.

Named after Guy Macdonald Morton, who described it at IBM in 1966. The resulting order traces a Z-shaped space-filling curve that largely preserves locality: points close together in space usually end up close together in the one-dimensional index.

That property makes Morton codes a workhorse for cache-friendly grids, spatial hashing and fast GPU construction of linear BVHs (LBVH), where primitives are first sorted on their Morton code.

← Back to the lexicon