Free 2×2 Pocket Cube Solver — Optimal in 11 Moves

Valid 2×2 cube state — click any sticker to fix a wrong color.

Cube net — click a sticker to fix it

8×6 grid of 24 stickers — 4 per face in the standard cross layout.

3D preview — drag to orbit

Twist the cube — try out moves

U
R
F
D
L
B

Click any move to twist the cube. Manual moves clear the active solution — treat this as a sandbox for learning notation or trying algorithms.

How the 2×2 solver works

The 2×2 (Pocket Cube) has only 3,674,160 reachable states — small enough to solve from scratch by bidirectional breadth-first search with no precomputed pruning tables. We BFS forward from the input state and backward from the solved state, alternating expansion of the smaller frontier until the two meet. With branching factor 6 (after deduping same-face moves), each side reaches depth ~6 with about 47,000 states; the meet typically happens within 100 milliseconds in pure JavaScript.

Solutions are guaranteed optimal — every cube is solved in at most 11 moves (God's Number for the 2×2 in face-turn metric, proven 1981). For comparison, the 3×3 has 4.3 × 1019 states and needs the Kociemba two-phase algorithm with megabytes of pruning tables; the 2×2 doesn't.

Frequently asked questions

What is God's Number for the 2×2?
11 in the face-turn metric — every solvable 2×2 state is reachable from solved in 11 face turns or fewer (Larson et al., 1981). The state space is just 3,674,160 positions, small enough to enumerate exhaustively.
How does the solver work?
Bidirectional BFS — search forward from your scrambled state and backward from solved at the same time, alternating which frontier to expand to keep the meet balanced. With 6 effective moves per state (we skip same-face repeats), each side reaches depth 6 with ~47K states, and the two meet at depth ≤11. No pruning tables needed.
Why doesn't this same solver work for the 3×3?
The 3×3 has 4.3 × 1019 states — bidirectional BFS to depth 10 each side would need petabytes of memory. The 3×3 needs Kociemba's two-phase algorithm with precomputed pruning tables. The 2×2's 3.7 million states fit comfortably in browser memory, so pure BFS is enough.
What notation does the solver use?
Standard cube notation: U / D / L / R / F / B for the six faces. Bare letter = 90° clockwise (looking at face from outside). Apostrophe = counter-clockwise (e.g. R'). 2 = 180° (e.g. F2). Since the 2×2 has no fixed centers, only 3 of the 6 faces are strictly necessary for solving — but all 6 are supported.
Can I solve a 2×2 by hand?
Easily — the 2×2 is the easiest puzzle in the Rubik's family. With practice, ~30 seconds intuitive solve with no memorized algorithms. Solve one face first (3-5 moves), then orient and permute the last layer with a small handful of standard moves. The optimal solution this solver shows uses fewer moves but moves that aren't always intuitive.
Do you have a 3×3 cube solver?
Yes — try the Rubik's Cube Solver (3×3). It uses Kociemba's two-phase algorithm via cubejs, returning solutions in ≤22 moves typically (God's Number for 3×3 = 20). Same 3D animated playback + GIF export + image-net parser.