Binary Square Creator
Create pixel art patterns on a binary grid. Toggle cells, apply symmetry modes, randomize, and export as PNG or SVG.
About
A binary square is an N Γ N grid where each cell holds exactly one of two states: 0 (off) or 1 (on). This simple constraint produces 2NΒ² possible configurations. For a modest 8 Γ 8 grid, that is 264 ≈ 1.84 Γ 1019 unique patterns. Getting symmetry right by hand is error-prone. A single misplaced cell breaks visual balance. This tool enforces symmetry constraints algorithmically so every toggle propagates to mirrored positions automatically.
The grid state maps directly to a binary string of length N2, read in row-major order. You can import or export this string to reproduce patterns exactly. Export supports lossless PNG at any cell resolution and scalable SVG. Note: very large grids (N > 48) may produce large files. The tool approximates visual weight by counting active cells as a fraction of total area.
Formulas
Each cell at row r and column c maps to a linear index in a binary string:
The full pattern is a binary string B of length N2 where B[i] β {0, 1}. Fill density (visual weight) is computed as:
Symmetry mirror indices for horizontal reflection:
For vertical reflection:
Quad symmetry combines both, adding the diagonal mirror (N β 1 β r, N β 1 β c).
Where N = grid dimension (rows = columns), r = row index (zero-based), c = column index (zero-based), B = binary string representation, D = fill density percentage, i = linear cell index.
Reference Data
| Grid Size | Total Cells | Unique Patterns | Binary String Length | Common Use |
|---|---|---|---|---|
| 4 Γ 4 | 16 | 65,536 | 16 bits | Icons, favicons |
| 5 Γ 5 | 25 | 33,554,432 | 25 bits | QR alignment patterns |
| 8 Γ 8 | 64 | 1.84 Γ 1019 | 64 bits | Chess boards, retro sprites |
| 10 Γ 10 | 100 | 1.27 Γ 1030 | 100 bits | Pixel art thumbnails |
| 12 Γ 12 | 144 | 2.23 Γ 1043 | 144 bits | Tile patterns |
| 16 Γ 16 | 256 | 1.16 Γ 1077 | 256 bits | Game sprites, emoji |
| 20 Γ 20 | 400 | 2.58 Γ 10120 | 400 bits | Detailed pixel art |
| 24 Γ 24 | 576 | 9.87 Γ 10173 | 576 bits | Toolbar icons |
| 32 Γ 32 | 1,024 | 1.80 Γ 10308 | 1,024 bits | Standard icon size |
| 48 Γ 48 | 2,304 | > 10693 | 2,304 bits | High-res icons |
| 64 Γ 64 | 4,096 | > 101233 | 4,096 bits | Detailed sprites, textures |
Frequently Asked Questions
crypto.getRandomValues and then enforces the selected symmetry mode. With quad symmetry on a 16 Γ 16 grid, only the top-left 8 Γ 8 quadrant is randomized. The remaining three quadrants are mirrored copies. Fill density can be adjusted via the density slider before randomizing.