In mathematics, a magic cube of order n {\displaystyle n} is an n × n × n {\displaystyle n\times n\times n} grid of natural numbers satisying the property that the numbers in the same row, the same column, the same pillar or the same length- n {\displaystyle n} diagonal add up to the same number. It is a 3 {\displaystyle 3} -dimensional generalisation of the magic square. A magic cube can be assigned to one of six magic cube classes, based on the cube characteristics. A benefit of this classification is that it is consistent for all orders and all dimensions of magic hypercubes.