Calculators
Two Knights Calculator
Count non-attacking placements of two knights on a rectangular chessboard using exact browser-only arithmetic.
Count ways to place two indistinguishable knights on distinct squares so neither attacks the other. Enter positive board dimensions of up to 100 digits. No other pieces or blocked squares are included. Results stay in your browser.
How to count non-attacking knight placements
For an r-row by c-column board, there are N = rc squares and N(N − 1)/2 unordered pairs of distinct squares. A knight moves two squares along one axis and one along the other. Each 2 × 3 or 3 × 2 sub-board contains two attacking pairs, so the attacking count is 2(r − 1)max(c − 2, 0) + 2max(r − 2, 0)(c − 1). Subtract this count from all pairs. On an 8 × 8 board there are 2016 pairs, of which 168 attack and 1848 do not. A 1 × 1 board gives zero placements; a 2 × 3 board gives 13 non-attacking placements. The knights are indistinguishable: swapping them does not create a new placement. This assumes a complete board without other pieces, blocked squares, wrapping edges or restrictions on square color. It counts placements, not moves or arrangements of more than two knights. Enter positive whole numbers with up to 100 decimal digits per dimension. Leading zeros and surrounding whitespace are accepted; signs, decimals, separators and exponents are rejected. Closed formulas and BigInt arithmetic preserve every result digit locally in your browser.
Frequently Asked Questions
Everything you need to know about this tool, how it works, and privacy.
How many non-attacking knight pairs fit on an 8 × 8 board?
There are 1848 unordered non-attacking pairs: 2016 pairs of distinct squares minus 168 attacking pairs.
How are attacking pairs counted?
Each 2 × 3 and 3 × 2 sub-board contributes two attacking pairs. Dimensions too small for such a sub-board contribute zero.
Are the two knights distinguishable?
No. Swapping the knights counts as the same placement. For two labeled knights, double the non-attacking result.
Can I use a one-row board?
Yes. Knights cannot attack each other on a one-row or one-column board. A single-square board has no pair of distinct squares.
Does this solve placements of many knights?
No. This calculator counts placements of exactly two knights on an otherwise empty rectangular board.