An octree is a tree data structure used to partition a three-dimensional space by recursively subdividing it into eight octants. It is commonly used in computer graphics, spatial indexing, and 3D game engines to efficiently manage and query spatial information.