Grid cells are defined functionally by their spatially periodic response patterns in two-dimensional (2D) space. Even anatomically, the cells in a grid module appear to be topographically arranged in cortical sheets in a 2D physical grid that mirrors their tuning to 2D external space, suggesting that the representation in a grid module is inherently two-dimensional. We show that a family of grid cell modules, each with 2D responses, can generate unambiguous representations of variables of much larger dimension. The idea generalizes our understanding of the grid code as possessing not only a uniquely large capacity but also being capable of flexible reconfiguration to generate unique path-integrable codes for arbitrary high-dimensional vector spaces.