For r rows and c columns, choose two of the r + 1 horizontal lines and two of the c + 1 vertical lines. The total is r(r + 1)c(c + 1) ÷ 4, including squares.
Decide which shapes count
This guide uses a complete rectangular grid with sides on its horizontal and vertical grid lines. Squares count as rectangles. Tilted shapes and diagonals do not count, and there are no missing cells or broken lines.
Rows and columns describe the cells, not the boundary lines. Two rows have three horizontal lines; three columns have four vertical lines. The outer border counts too.
Choose boundaries to get 18 rectangles in a 2-by-3 grid
Each rectangle needs a top and bottom boundary. From three horizontal lines, the possible pairs are first–second, first–third and second–third: 3 choices. From four vertical lines, there are 6 choices for the left and right boundaries.
Every horizontal pair works with every vertical pair, so the total is 3 × 6 = 18. Each selection identifies exactly one rectangle. You are choosing unordered pairs of distinct lines: swapping “top” and “bottom” does not create another shape.
Check the answer by counting every size
| Height × width in cells | Number of positions |
|---|---|
| 1 × 1 | 6 |
| 1 × 2 | 4 |
| 1 × 3 | 2 |
| 2 × 1 | 3 |
| 2 × 2 | 2 |
| 2 × 3 | 1 |
| Total | 18 |
A rectangle h cells high and w cells wide has (r − h + 1)(c − w + 1) possible positions. For example, a 1-by-2 rectangle fits in two horizontal positions in each of two rows: 2 × 2 = 4. Add all six size counts to confirm 18.
Apply the same formula to a larger complete grid
A grid with r rows has r + 1 horizontal boundaries. The number of pairs is r(r + 1) ÷ 2. Similarly, c columns provide c(c + 1) ÷ 2 vertical pairs. Multiplying gives r(r + 1)c(c + 1) ÷ 4.
For a 3-by-4 grid, the horizontal count is 3 × 4 ÷ 2 = 6 and the vertical count is 4 × 5 ÷ 2 = 10. Therefore it contains 60 rectangles. Use the pair counts before multiplying if the combined formula looks crowded.
Try six rectangle-counting questions
Count rectangles of every size, including squares, with sides on the grid lines. Each question uses a complete grid of square cells.
1. How many rectangles are in a 1-row, 1-column grid?
1. Two horizontal and two vertical lines each provide one pair. The single square is also a rectangle.
2. How many rectangles are in a 1-row, 4-column grid?
10. There is one horizontal pair and 5 × 4 ÷ 2 = 10 vertical pairs. Counting widths gives 4 + 3 + 2 + 1 = 10.
3. How many rectangles are in a 2-row, 2-column grid?
9. Three horizontal lines give three pairs, as do three vertical lines. The total is 3 × 3 = 9.
4. How many rectangles are in a 2-row, 3-column grid?
18. Multiply three horizontal pairs by six vertical pairs. The six small cells are only one size within the total.
5. How many rectangles are in a 3-row, 4-column grid?
60. Four horizontal lines give six pairs; five vertical lines give ten. Thus 6 × 10 = 60.
6. How many rectangles are in a 4-row, 5-column grid?
150. Five horizontal lines give ten pairs; six vertical lines give fifteen. Multiply 10 × 15 = 150.
Use the free challenge to check your method
The free Math Puzzle Challenge includes the 2-by-3 grid and an answer check. Solve it before opening the hint, then compare the explanation with your boundary pairs. These original website exercises are separate from Math Riddles app levels.
If you missed a constraint, use the puzzle strategy checklist. For another grid task, try missing-number puzzles; for the products, review mental multiplication shortcuts.
Common questions
Do squares count when counting rectangles?
Yes, under the rule used here. A square is a rectangle with equal side lengths. Read the question carefully if it excludes squares.
Does turning the grid sideways change the total?
No. Swapping rows and columns swaps the two pair counts without changing their product.
Can I use the formula on a grid with missing lines?
Not directly. The formula assumes every chosen pair of horizontal and vertical lines forms a complete rectangle.
Published by Moocsoft, the independent studio behind Math Riddles. Examples and worksheets are illustrative. App features can vary by platform and version; see the store listing for current availability and in-app purchases.