Rubik's Cube Solver

Turn it, scramble it, and watch it solved step by step.

Runs in your browser Free · no account

Loading the cube…

About the Rubik's Cube Solver converter

Drag the cube to turn it round, press the letters to turn its faces, and scramble it. Then have it solved a move at a time, with each stage named and explained as it happens.

It runs entirely in this page — no app, no account, and nothing sent anywhere. The cube, the scramble and the solution all live on your own machine.

Twenty moves exist, and you would not want them

Every position of a Rubik's Cube can be solved in twenty moves or fewer. That was proved in 2010 using a great deal of donated computing time, and twenty is now called God's number — the worst case, with no position anywhere needing a twenty-first.

Finding those twenty is another matter entirely. The methods that manage it search pre-computed tables holding hundreds of millions of positions, which would mean sending several megabytes to somebody who wanted to solve one cube. And the answer would be twenty moves with no structure at all: nothing to understand, nothing to remember, and no way to check you had done it right halfway through.

So it is solved the way you would be taught

Seven stages. The cross on the bottom, then the bottom corners, then the four edges of the middle layer — at which point two of the three layers are finished and stay finished. Then the top in four steps: the cross, the corners into their slots, the corners turned upright, and finally the edges slid round.

It comes to something over a hundred moves rather than twenty, and every one of them belongs to a stage with a name. You can stop halfway, look at the cube in your hands, and see exactly where you are — which is the thing a twenty-move solution can never give you.

The notation, which is simpler than it looks

Each of the six faces has a letter: U for up, D for down, F for front, B for back, L and R for left and right. A plain letter means turn that face a quarter turn clockwise, looking straight at it from outside. An apostrophe means anticlockwise, and a 2 means a half turn, where the direction does not matter.

That is the entire notation, and it is the same one used by every solution, every algorithm and every competition scramble you will ever read. "R U R' U'" — the four moves cubers call the sexy move — is turn the right face towards you, the top face left, the right face back, the top face back. Doing it six times returns the cube to exactly where it started.

What the last four stages are doing

The top layer cannot be solved by putting pieces in one at a time, because there is nowhere left to work — anything you do to place one piece disturbs the two layers already finished. So it is done with algorithms: sequences that scramble the cube and then unscramble it, leaving one small change behind.

The corner-turning stage is the one that alarms people. It repeats four moves that visibly wreck the bottom two layers, and then puts them back — because the whole thing is done four times over, and four quarter turns of the top add up to none. Watching it happen is worth more than any explanation of it.

How the cube is modelled

The usual approach is a table saying where each of the fifty-four stickers goes for each move. That works, and it is very hard to get right by hand: one transposed pair produces a cube that turns correctly for a while and then reaches a position no real cube can occupy.

Here it is twenty-six little cubes in space instead, each carrying its stickers on outward-facing sides, and a move genuinely rotates the nine in a layer — their positions and their stickers together, the same way your hands would. The fast tables the solver needs are generated from that model rather than typed in, so there is nothing left to mistype.

Checked against facts about cubes, not about the code

Turning the right face and then the top face, over and over, returns the cube to its starting position after exactly 105 repetitions. The four moves of the sexy move come back after six. A quarter turn of any face four times is nothing at all, and opposite faces can be turned in either order for the same result while adjacent ones cannot.

None of those are facts about this program — they are facts about the cube, which is what makes them worth testing against. On top of them, a thousand randomly scrambled cubes are solved and every one checked to have actually come out solved, because a solver made of stages is a pile of special cases and the only honest way to know they are all covered is to try a great many.

Frequently asked questions

Can it solve my actual cube?

It solves any scramble you give it. Type the moves you made, or paste a competition scramble, and follow the solution on your own cube — the notation is the standard one, so the moves match what is in your hands.

Why is the solution over a hundred moves?

Because it is the beginner method, the same one a person is taught, and its value is that every move belongs to a step you can understand. Twenty-move solutions exist but need a search through hundreds of millions of positions and cannot be explained or remembered.

What is God's number?

Twenty. It is the largest number of moves any cube position needs, proved in 2010. Almost every position needs between seventeen and twenty, which is far fewer than most people expect.

What does R U R prime mean?

R is a quarter turn of the right face clockwise as you look at it, U the same for the top, and the apostrophe in R' means anticlockwise instead. So R U R' is right clockwise, top clockwise, right back again.

How many positions does a cube have?

About 43 quintillion — 43,252,003,274,489,856,000. Turning one face every second since the universe began would not get you through a fraction of them, which is why solving by trying things does not work and a method is needed.

Does it work on a phone?

Yes. Drag to turn the cube round and tap the letters to turn its faces. It is drawn with ordinary browser transforms rather than a 3D library, so it stays light and starts instantly.

Is anything uploaded?

No. The cube, the scramble and the solving all happen in this page on your own machine. You can turn the network off and it carries on working.