Skip to the page
Explorable Illusions

See for yourself — then run it 100,000 times.

Magic Square: 1514 Sits in Dürer’s Bottom Row

Explorable Illusions · Published

Pick any row, column or diagonal of this square; it adds up to 34. That property makes it a magic square, a grid of numbers in which every row, every column and both main diagonals share the same total. Albrecht Dürer engraved this particular square into Melencolia I, a print dated 1514, and the middle of its bottom row reads 15 14. This page's program counts 7,040 magic squares of this size that use the numbers 1 to 16 exactly once, or 880 if the turns and flips of one square count only once.

Protocol · 4 parts
Dürer's 4 by 4 square of the numbers 1 to 16, with the sum 34 printed beside every row, column and diagonal.

Open the diagram full size

Dürer's square, with the sum of each row, column and main diagonal. All ten lines come to 34."Dürer's magic square with its ten line sums" by Explorable Illusions — https://explorableillusions.com/math-toys/magic-square/ — CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

At a glance

Name
Magic square
Also called
Dürer's magic square (the 4 x 4 square in Melencolia I)
First recorded
This entry starts from Albrecht Dürer's engraving Melencolia I, dated 1514; it does not date the earliest magic square
Type
Number arrangement: every row, column and main diagonal has the same sum
Main explanations
Checked by exhaustive count: Dürer's square uses 1 to 16 once and all ten lines add to 34; 86 sets of four cells add to 34 in any arrangement of 1 to 16; there are 7,040 magic squares of order 4, or 880 if turns and flips of one square count once, a first full count credited to Frénicle de Bessy (1693)
On this page
Static figures and recomputable data: every set of four that adds to 34, and the full counts of 3 x 3 and 4 x 4 squares

magic-square-glance.csv (CSV) · what the file holds and its license

Before reading further, add up the four corners, 16, 13, 4 and 1, and then try the four cells in the middle. On this page, the gasp point arrives in the second section as a shuffle: mix the sixteen numbers at random, and exactly 86 sets of four still add up to 34.

Where is the square in Melencolia I?

Melencolia I is a copper engraving by Albrecht Dürer, the Nuremberg artist who lived from 1471 to 1528. The impression in the National Gallery of Art in Washington is a sheet 24.2 centimeters tall and 18.8 centimeters wide. The square hangs on a wall in the upper right corner, beneath a bell and beside an hourglass, above a seated winged figure.

Engraved 4 by 4 grid of numbers on a wall: 16 3 2 13, 5 10 11 8, 9 6 7 12, and 4 15 14 1.
The square as Dürer cut it into the plate, from the National Gallery of Art's scan of Melencolia I."Melencolia I (detail: the magic square)" by Albrecht Dürer — https://commons.wikimedia.org/wiki/File:Albrecht_D%C3%BCrer,_Melencolia_I,_1514,_NGA_6640.jpg — CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0/); modified: cropped to a 4:3 frame around the whole magic square with a strip of the wall, the foot of the bell, part of the rope and the edge of the hourglass frame; scaled to 1,200 x 900 px

Several digits are cut in older shapes: the 5 resembles a tall S, and the 9 curls like a hook. Read cell by cell from the museum's scan, the engraved square matches the version drawn above:

Column 1Column 2Column 3Column 4
Row 1163213
Row 2510118
Row 396712
Row 4415141

What the square symbolizes inside the print is a question for art historians, and no source this page could read settles it. This page sticks to what anyone can check: the numbers and their totals.

How many sets of four add up to 34?

Rows, columns and diagonals are only ten of the possible ways to choose four cells from sixteen. There are 1,820 combinations altogether, and this page's program tested every one of them. In Dürer's square, 86 of those combinations add up to 34.

Seven small copies of the square, each with one set of four shaded: rows 4, columns 4, diagonals 2, blocks 5, and more.

Open the diagram full size

The 86 sets of four that add to 34, sorted by shape. Each copy shades one example of its shape."The 86 sets of four cells in Dürer's square that add to 34, by shape" by Explorable Illusions — https://explorableillusions.com/math-toys/magic-square/ — CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

Many of the 86 form recognizable shapes. Five of the nine 2×2 blocks total 34: the four corner quarters and the central block. The four corners of the whole square also qualify, along with 14 more sets that mark the corners of a rectangle with sides along the grid lines.

A separate pattern explains 22 more sets. Every cell and the cell directly opposite it through the center add to 17, as with 16 and 1 or 3 and 14, so any two of these mirror pairs together make 34.

Now the twist. The number 86 does not depend on Dürer's arrangement at all, because exactly 86 combinations of four different numbers from 1 to 16 add up to 34, wherever those numbers sit in the grid. Any shuffle of the sixteen numbers leaves the count at 86; what Dürer's layout controls is how many of the 86 form tidy shapes, which here is 52.

The birthday paradox works the same way, since its surprise comes from counting groups, such as the 253 pairs among 23 people, rather than from any single person.

What does the bottom row say?

The bottom row of the square reads 4, 15, 14, 1, so its two middle cells, side by side, spell 15 14. The engraving carries the date 1514 in its lower right corner, cut just above an A and a D.

The square with its bottom row shaded; the middle cells 15 and 14 are dark, and the row sums 4 + 15 + 14 + 1 = 34.

Open the diagram full size

The bottom row of Dürer's square. Its middle two cells read 15 14, and the whole row adds to 34."The bottom row of Dürer's magic square" by Explorable Illusions — https://explorableillusions.com/math-toys/magic-square/ — CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

The program checked how often that happens. Of all 7,040 magic squares that use 1 to 16, it found only 32 with 15 followed by 14 in the middle of the bottom row, and only 10 with the complete bottom row 4, 15, 14, 1, including Dürer's own. No source read for this page records whether the date came first in his design.

How many 4×4 magic squares are there?

A square can be rotated a quarter, a half or three quarters of the way around, and each position can also be flipped over, which gives 8 views of one square. For Dürer's square, all 8 views are different. Every one of them is still a magic square.

Eight copies of Dürer's square, turned and flipped, with the cell holding 1 shaded in each copy.

Open the diagram full size

One square, eight views. For 4×4 squares of the numbers 1 to 16, counting all views gives 7,040 magic squares; counting each square once gives 880."Dürer's magic square in its eight turns and flips" by Explorable Illusions — https://explorableillusions.com/math-toys/magic-square/ — CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

The program examined every way to fill a 4×4 grid with 1 to 16 so that each row totals 34, then tested the columns and diagonals of each candidate. It found 7,040 magic squares. Every square had 8 distinct views, so 7,040 ÷ 8 = 880.

A 2013 paper by the mathematicians Stefano Barbero, Umberto Cerruti and Nadir Murru reports the same two numbers and credits the first complete count to Frénicle de Bessy, in 1693. For a 3×3 grid of the numbers 1 to 9, the same exhaustive search finds 8 magic squares, all of them views of a single square. As with the walks in the Seven Bridges of Königsberg, the answer comes from checking every possible case, not from a clever guess.

Check it yourself

Every count below is exact. As in the Benford's law entry, nothing is sampled, because the program lists every case. The third column describes Dürer's square with its first two columns exchanged (see Now break it).

CountDürer's squareColumns 1 and 2 swapped
Lines (of 10) that add to 34108
Sets of four cells (of 1,820) that add to 348686
Of those, sets in a tidy shape5232
Of those, sets with no simple shape3454
Cell and opposite cell always add to 17yesno
GridMagic sumMagic squaresCounting turns and flips once
3×3, numbers 1 to 91581
4×4, numbers 1 to 16347,040880

Download every set of four that adds to 34 (CSV) · what the file holds and its license

Download the full count of 3×3 and 4×4 squares (CSV) · what the file holds and its license

Now break it

Exchange the first two columns of Dürer's square. Every row keeps the same four numbers, and every column keeps its own numbers too, so all eight of those lines still total 34.

Dürer's square with its first two columns shaded and all ten line sums at 34.

Open the diagram full size

Before: Dürer's square, first two columns shaded. Ten lines, all 34."Dürer's magic square before a column swap" by Explorable Illusions — https://explorableillusions.com/math-toys/magic-square/ — CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

The diagonals are what break: one drops to 16 and the other climbs to 48, so the grid is no longer magic. All 86 sets of four that add to 34 are still present, but only 32 of them now form tidy shapes, down from 52.

The same square with columns 1 and 2 swapped; rows and columns still 34, diagonals 16 and 48 in red.

Open the diagram full size

After: columns 1 and 2 swapped. Rows and columns still add to 34; the diagonals come to 16 and 48."Dürer's square with its first two columns swapped" by Explorable Illusions — https://explorableillusions.com/math-toys/magic-square/ — CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

Try exchanging the two middle columns instead. The program reports that this swap keeps all ten lines at 34, so the result remains a magic square.

Try this next: 15 puzzle — the same 4×4 frame, with fifteen sliding tiles and one swap of 14 and 15 that no amount of sliding can make.

Sources

  1. Albrecht Dürer, Melencolia I, engraving, 1514. National Gallery of Art, Washington, Rosenwald Collection, 1943.3.3522; scan released by the museum under CC0 on Wikimedia Commons. https://commons.wikimedia.org/wiki/File:Albrecht_D%C3%BCrer,_Melencolia_I,_1514,_NGA_6640.jpgRead: file page and full-resolution scan; the square and the date checked cell by cell
  2. Stefano Barbero, Umberto Cerruti and Nadir Murru, “Squaring the Magic Squares of Order 4,” arXiv:1302.1163 (2013); Journal of Algebra, Number Theory: Advances and Applications 7, no. 1 (2012): 31–46. https://arxiv.org/abs/1302.1163Read: pages 1–3 (introduction and section 2)

Cite this page

Explorable Illusions. (2026). Magic Square: 1514 Sits in Dürer’s Bottom Row. Explorable Illusions. Published 2026-11-13. https://explorableillusions.com/math-toys/magic-square/

Add the date you read it. Figures and CSV files on this page are CC BY 4.0 unless their credit line says otherwise.

How pages here are checked Corrections log Report an error: contact@explorableillusions.com

More in Puzzles, Fractals & Math Toys

  • Dark heart-shaped body with a round bulb on its left, ringed by purple and green bands.
    Puzzles, Fractals & Math Toys

    Mandelbrot Set: Exact Area Still Unknown as of 2026

    Square, add c, repeat: the Mandelbrot set is every point that never escapes. As of 2026 its exact area is unknown; grid counts put it near 1.51.

    Picture credit

    "The Mandelbrot set, full view" by Explorable Illusions — https://explorableillusions.com/math-toys/mandelbrot-set/ — CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

  • Hand-drawn 17th-century map of a walled city with a river splitting into two branches around an island.
    Puzzles, Fractals & Math Toys

    Seven Bridges of Königsberg: No Walk Crosses Each Once

    The seven bridges of Königsberg join four lands that touch 5, 3, 3 and 3 bridges. See why no walk crosses each bridge once, and why dropping any one fixes it.

    Picture credit

    "Topographia Practica – 3. Regiomontum (Königsberg)" by Fryderyk Getkant — https://commons.wikimedia.org/wiki/File:Topographia_Practica_-_3._Regiomontum.jpg — Public domain (US: hand-drawn map made 1634–39 by an author who died in 1666, public domain whether counted as published (before 1931) or unpublished (life plus 70 years); EU: author d. 1666, more than 70 years ago); modified: scaled from 7,544 to 1,600 px wide; no crop, no colour change

  • Cartoon: a man holds his head beside a box of numbered blocks with politicians' heads, marked THE “BOSS” PUZZLE
    Puzzles, Fractals & Math Toys

    15 Puzzle: With 14 and 15 Swapped, No Solution Exists

    Swap tiles 14 and 15 in a 15 puzzle and no series of slides can fix it. Count the pairs out of order to see why, as Johnson and Story proved in 1879.

    Picture credit

    "15-14-13. The great presidential puzzle (Puck, 1880)" by James Albert Wales — https://commons.wikimedia.org/wiki/File:15-14-13._The_great_presidential_puzzle_-_J.A._Wales._LCCN2007684705.jpg — Public domain (US: published 1880 in Puck; EU: artist James Albert Wales d. 1886, per the Library of Congress catalog); modified: cropped to the printed picture, removing the album page and the printed title, publisher and lithographer lines below it; scaled to 1600 px wide