Crossword Puzzle
Generate and solve interactive crossword puzzles with custom words or themed presets. Full keyboard navigation, timer, hints, and printable grid.
About
Crossword construction is a constraint-satisfaction problem. Each word must intersect at least one other word at a shared letter, and no two words may conflict in overlapping cells. A grid of size N × N with W words requires evaluating up to O(W! ⋅ N2) placement candidates in the worst case. This tool uses a greedy backtracking algorithm that prioritizes intersection density to produce compact, solvable grids. Manual grid construction without algorithmic validation frequently produces orphaned words or conflicting cells. The generator rejects placements that create invalid two-letter adjacencies or isolated regions.
Note: the algorithm approximates optimal density but does not guarantee a unique solution for all word sets. Word sets with few shared letters (e.g., words heavy in Q, X, Z) may produce sparser grids. For best results, provide 8 to 20 words of varying length with common English letter distributions.
Formulas
The crossword generator evaluates each candidate word placement using an intersection density score:
Where Splacement is the placement score, I is the number of letter intersections with existing words, L is the candidate word length, Dcenter is Manhattan distance from grid center, w1 = 0.7 and w2 = 0.3 are weighting coefficients. Higher scores yield more compact, interconnected grids.
Grid size is auto-calculated as:
Where Lmax is the longest word length and W is total word count. This ensures the grid accommodates all words with adequate padding.
Reference Data
| Preset Theme | Word Count | Avg. Word Length | Difficulty | Best Grid Size |
|---|---|---|---|---|
| Solar System | 12 | 6.3 | Easy | 15 × 15 |
| World Capitals | 14 | 6.8 | Medium | 17 × 17 |
| Programming | 12 | 7.1 | Medium | 15 × 15 |
| Ocean Life | 11 | 6.5 | Easy | 15 × 15 |
| Music Genres | 10 | 5.9 | Easy | 13 × 13 |
| Human Anatomy | 13 | 7.4 | Hard | 17 × 17 |
| Ancient History | 12 | 7.0 | Hard | 17 × 17 |
| Kitchen & Cooking | 11 | 6.2 | Easy | 15 × 15 |
| Mathematics | 12 | 7.3 | Medium | 17 × 17 |
| Sports & Games | 12 | 6.7 | Medium | 15 × 15 |
| Weather & Climate | 10 | 6.8 | Medium | 15 × 15 |
| World Languages | 11 | 6.5 | Medium | 15 × 15 |