Curious Jr By PW

Magic Square - Definition, Formula and Examples

A magic square is a grid of distinct numbers arranged so that the sums of every row, column, and diagonal are equal, known as the magic constant. A famous example appears in Albrecht Dürer’s 1514 engraving Melencolia I, which features a 4×4 magic square. In its bottom row, the numbers 15 and 14 appear side by side, cleverly referencing the year 1514, when the artwork was created.
authorImageShivam Singh6 Nov, 2025
Magic Square

What is a Magic Square?

A magic square is a square grid of order n, divided into n² smaller cells, in which the integers from 1 to n² are arranged so that the sum of the numbers in each row, each column, and both main diagonals is always the same. This common total is known as the magic constant.

For example, in a magic square of order 3 (that is, a 3 × 3 grid), the numbers from 1 to 9 are placed in such a way that every row, column, and diagonal adds up to 15.

Read More: Mental Math Strategies

What is a Magic Square Puzzle?

A magic square puzzle is a type of number puzzle that is made using a square-shaped grid. The grid is filled with different numbers, and the special rule is that the total of each row, each column, and both of the main diagonals must be the same. This total is called the magic constant or the magic square number.

In most magic square puzzles, the numbers used are whole numbers that follow each other in order without skipping. These are called consecutive numbers. Magic squares are a part of recreational mathematics, which means they help students learn through fun activities rather than strict lessons. 

Magic squares come in different sizes, such as 3 by 3, 4 by 4, and so on. The number of boxes and the magic constant depend on the size of the square.

Magic Square Puzzle Example

Let us look at a 3 by 3 magic square puzzle. This puzzle uses the numbers from 1 to 9. The numbers are placed in a grid that has 3 rows and 3 columns. The aim is to arrange the numbers so that the total of each row, each column, and both diagonals is the same.

Here is one example of a 3 by 3 magic square:

2 7 6
9 5 1
4 3 8

Now let us check if this follows the rule. If you add the numbers in the first row, you get 2 plus 7 plus 6, which equals 15. The second row gives 9 plus 5 plus 1, which is also 15. The third row adds up to 4 plus 3 plus 8, again giving 15.

The same result happens when you add the numbers in each column and both diagonals. So, in this case, the magic constant is 15.

Read More: Fun Math Activities for Kids to Develop Calculation Speed

Magic Square Formula

To solve or create a magic square, we use a simple formula to find the magic constant (M):

M = n(n2 + 1)/2

Here, n is the number of rows or columns in the square.

Let’s try an example. For a 4 x 4 magic square, n = 4:

M = 4(42 + 1)2  = 4(16+1)2 = 4 × 17/2 = 34

So, the sum of numbers in every row, column, and diagonal should be 34.

Read More: Brackets in Maths

How to Solve a Magic Square Puzzle?

Let us take a 5 by 5 magic square. This square has 5 rows and 5 columns, using the numbers from 1 to 25. The goal is to place these numbers so that the total of every row, column, and diagonal is the same. This total is called the magic constant.

To find the magic constant, use the formula:

Magic constant = n(n² + 1) ÷ 2

Here, n = 5

So, the magic constant is 5 × (25 + 1) ÷ 2 = 65

One way to solve it is to start with the number 1 in the middle of the top row. Then move up one row and right one column to place the next number. If you go outside the grid, wrap around to the opposite side. If the box is already filled, move down one step and continue.

Here is a completed 5 by 5 magic square:

17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9

Every row, column, and diagonal adds up to 65. This is a normal magic square because it uses numbers from 1 to 25 in order.

Read More: Vedic Maths Tricks

How to Make a 4 x 4 Magic Square

A 4 x 4 magic square uses numbers from 1 to 16. The magic constant is 34. You can make one by following these steps:

Step 1: Draw a 4 by 4 grid.

 Step 2: Write the numbers 1 to 16 in order, left to right, row by row.

Like this:

1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16

Step 3: Find these special boxes:

  • The four corners

  • The four boxes in the center (they make a small square)

Keep these 8 numbers as they are.

Step 4: For all other boxes (the ones not in step 3), change each number by doing:
17 minus that number

Example:

  • 2 becomes 17 − 2 = 15

  • 3 becomes 17 − 3 = 14

Do this for all the remaining boxes.

Final Magic Square:

1 15 14 4
12 6 7 9
8 10 11 5
13 3 2 16

Now, check it. Every row, column, and diagonal adds up to 34.

Read More: 10-Minute Daily Exercises to Improve Mental Maths Skills

Magic Square Magic Trick

Want to try a cool magic square magic trick? Here is a fun way to build a 3 x 3 magic square using a simple method.

Step 1: Let the order be x = 3 (because it's a 3 by 3 square).

Step 2: Find the magic constant. For a 3 x 3 square, it is 15. Now divide the magic constant by the order:

y = 15 ÷ 3 = 5

Step 3: Start building the square like this:

  • Place y (5) in the center box

  • Place x (3) to the left of the center

  • Use these values to fill the rest using simple patterns:

  • Above the left box, write y − 1 = 4

  • To the right of the center, write 2y − x = 7

  • Below the center, write y + 1 = 6

And so on, using small additions and subtractions

Final Magic Square:

4 9 2
3 5 7
8 1 6

Each row, column, and diagonal adds up to 15. With a little practice, you can create it in seconds and show it as a fun trick.

Magic Squares Fun Facts

  • Magic squares have been around for thousands of years.

  • They were used in ancient China, India, and the Arab world.

  • People once believed they had magical or protective powers.

  • Magic squares also appear in art, temples, and architecture, showing their beauty and importance.

  • Today, they are used as math puzzles to help students learn patterns and logic in a fun way.

Also Read: Abacus vs. Vedic Maths

Make Your Child a Math Wizard with CuriousJr’s Mental Maths Course

Does your child still count on fingers or hesitate with basic calculations? Many parents face the same concern and want their kids to become faster and more confident in maths. That’s exactly what we help with.

At CuriousJr, we have built a Mental Maths Course for Classes 1 to 8 that makes learning fun and effective. Through engaging activities, tricks, and daily practice, your child learns to calculate quickly without using fingers or calculators.

Our program includes live sessions, regular progress updates, doubt-clearing support, and exciting rewards to keep kids motivated. Each class blends fun with focus, helping your child sharpen logic, memory, and speed.

Give your child a lasting edge in maths. Book a demo class today for just ₹99 and watch how CuriousJr makes learning exciting and rewarding!

Magic Square FAQs

What is a magic square puzzle?

A magic square puzzle is a grid where numbers are arranged so that the sum of each row, column, and diagonal is always the same. This total is called the magic constant or the magic square number.

What is the use of magic squares in maths?

Magic squares help students practice addition, spot number patterns, and think logically. They are part of a fun area in maths called recreational mathematics.

How to find the magic constant in a magic square?

You can find the magic constant using this magic square formula: M = n(n² + 1) ÷ 2, where n is the number of rows or columns.

What is a normal magic square?

A normal magic square uses consecutive numbers starting from 1. For example, a 4 x 4 magic square uses numbers from 1 to 16.
Curious Jr By PW

Curious Jr By PW

We understand that every student has different needs and capabilities, which is why we create such a wonderful and unique curriculum that is the best fit for every student.