If replacing each number by its square or cube in a magic square produces another magic square, the square
is said to be a trimagic square. Trimagic squares are also called trebly magic squares,
and are 3-multimagic squares.

Trimagic squares of order 12, 32, and larger are known. Tarry (1906) gave a method for constructing a trimagic square of order 128, Cazalas a method for trimagic squares of orders 64 and 81, R. V. Heath a method for constructing an order 64 trimagic square which is different from Cazalas's (Kraitchik 1942), and Benson (Benson and Jacoby 1976) a method for constructing an order 32 trimagic square.

Walter Trump constructed the first trimagic square of order 12 in June 2002. This square, illustrated above, is the smallest possible trimagic square, since Boyer and Trump subsequently proved that a trimagic square of order less than 12 cannot exist (Boyer).