Free · no sign-up · works offline
Rubik's Cube Solver
Paint your cube’s colours onto the net below and press Solve. You get a solution of 20 moves or fewer, usually in about a fifth of a second, animated turn by turn on a 3D cube you can drag, pause and step backwards. Everything runs inside your browser — nothing is uploaded, and it keeps working with the network off.
Move 1 of 20 — Front face clockwise
Solution
20 moves
The first 9 moves put every corner and edge the right way up and the middle-slice edges back in the middle slice. The last 11 finish the cube using only U, D and half turns.
Pick a colour, then click the squares
Tab to any square and press 1–6 to paint it. Hold the mouse down to drag across several at once.
Applies the moves to a solved cube. Useful if you already have a competition scramble and want to see how it is meant to come apart.
What the numbers mean
God's number
20
Proved 2010, half-turn metric
Typical answer here
18–21
Two-phase, not exhaustive
Search time
~190 ms
Median, once the tables are built
Cube positions
43 quintillion
43,252,003,274,489,856,000
A beginner’s layer-by-layer method takes roughly 100 turns. A good speedcuber using CFOP averages about 55. This solver averages 20.3, because it is not following a method at all — it is searching for a short sequence directly.
How do you use a Rubik's cube solver?
- Hold the cube with white on top and green facing you. The six centres never move relative to one another, so this is what tells the solver which face is which. If your cube uses a different colour scheme, set the centres first and work from those.
- Copy the colours onto the net. Choose a colour from the palette, then click squares. The counter beside each colour turns grey once you have all nine. Keyboard users can tab to a square and press 1 to 6.
- Press Solve. If something is wrong the solver says exactly what — a twisted corner, a flipped edge, two swapped pieces — and highlights the squares involved.
- Follow the moves on the 3D cube. Press Play, or step through one turn at a time. Click any move in the list to jump straight to it. Every letter is explained on the Rubik’s cube notation page.
Why does this solver find 20 moves when a beginner's method needs 100?
Layer-by-layer methods work one piece at a time and never undo progress, which is exactly why they are learnable — and exactly why they are long. Every algorithm has to restore whatever it disturbed, so most of its turns are setup and cleanup rather than useful work.
Herbert Kociemba’s 1992 two-phase algorithm drops that constraint. It splits one impossible search into two tractable ones. Phase one cares about exactly three things: that every corner is untwisted, every edge unflipped, and the four middle-slice edges are somewhere in the middle slice. The states with those properties form a subgroup written G1 = ⟨U, D, R2, L2, F2, B2⟩, and it is closed under the ten moves that cannot disturb them.
Phase two then finishes the cube using only those ten moves. Each phase is small enough to tabulate exactly, so neither search ever has to guess how far it is from the goal. This site builds four such tables — 5.5 MB in total, about 200 milliseconds of arithmetic — the first time you open a solver page.
The honest catch: a two-phase solution is not guaranteed optimal, because the split itself can cost a move or two. That is why answers land between 18 and 21 rather than always at the theoretical minimum. Proving a solution optimal for an arbitrary cube takes minutes to hours, not milliseconds.
How far is a scrambled cube from solved?
The distribution below comes from the 2010 proof and the enumeration work that followed it. The concentration is extreme: essentially every cube you will ever scramble sits 17 or 18 moves from solved, and positions that genuinely need all 20 are so scarce that fewer than half a billion have been catalogued out of 43 quintillion.
| Moves from solved | Positions at that distance | Share of all positions |
|---|---|---|
| 10 | 232,248,063,316 | 0.0000005% |
| 11 | 3,063,288,809,012 | 0.000007% |
| 12 | 40,374,425,656,248 | 0.00009% |
| 13 | 531,653,418,284,628 | 0.001% |
| 14 | 6,989,320,578,825,358 | 0.02% |
| 15 | 91,365,146,187,124,313 | 0.2% |
| 16 | about 1,100,000,000,000,000,000 | 2.5% |
| 17 | about 12,000,000,000,000,000,000 | 28% |
| 18 | about 29,000,000,000,000,000,000 | 67% |
| 19 | about 1,500,000,000,000,000,000 | 3.5% |
| 20 | at least 490,000,000 known | under 0.000000002% |
A note on the word “optimal”
Plenty of solver sites claim optimal solutions. Almost none of them are. A true optimal solver has to prove that no shorter sequence exists, which means a search that runs for minutes on hard positions. This site says two-phase because two-phase is what it runs. The 2×2 solver and the Pyraminx solver genuinely are optimal — those puzzles are small enough to hold every single position in memory.
Common questions
- How does this Rubik's cube solver work?
- It runs Kociemba's two-phase algorithm in your browser. Phase one turns the cube into a state solvable with only U, D and half turns; phase two finishes it inside that restricted set. Both phases use exact distance tables built by breadth-first search, which is why the answer is around 20 moves rather than the 100 a beginner's method takes.
- What is the fewest moves a Rubik's cube can be solved in?
- Twenty. That figure is called God's number and it was proved in 2010 by Rokicki, Kociemba, Davidson and Dethridge, using about 35 CPU-years donated by Google to check all 43,252,003,274,489,856,000 positions. No position needs more than 20 face turns, and only a tiny fraction need all 20.
- Do I need to hold the cube a particular way?
- Yes, and it matters. Hold it with the white centre on top and the green centre facing you, then copy the colours onto the net exactly as you see them. The centres never move relative to each other, so they define which face is which — that is why the solver leaves them fixed.
- The solver says my cube is impossible. What went wrong?
- Usually a mis-clicked sticker. If the colours are right but the solver still refuses, the cube itself has been taken apart and rebuilt wrong: a corner twisted in its socket, a single edge flipped, or two pieces swapped. Those three faults are the only ways an assembled cube can be unsolvable, and the solver names which one you have.
- Is this free, and does it send my cube anywhere?
- It is free with no account, and nothing leaves your device. The whole solver — about 5.5 MB of move and pruning tables — is built inside your browser in a Web Worker as the page loads. There is no server call when you press Solve.
- Can I use this to cheat at speedcubing?
- Not usefully. WCA competitions give you 15 seconds of inspection on a scramble you have never seen, so a solver is no help. What it is good for is checking a solution you found yourself, seeing what an efficient solve looks like, and rescuing a cube you have scrambled into a state you cannot undo.
Pick the right tool
- 3×3 Rubik's cube solverThe same engine, with a walkthrough of how the two phases split the work.
- How to solve a Rubik's cubeThe beginner's layer-by-layer method: seven stages, eight algorithms to learn.
- Rubik's cube 3×3 solutionA printable solution sheet with every algorithm on one page.
- Rubik's cube notationWhat U, R', F2, Rw and M mean, with a worked example for each.
- Scramble generatorWCA random-state scrambles for 2×2 through megaminx.
- Speedcubing timerInspection countdown, Ao5 and Ao12, session kept in your browser.