Rubik's Cube Solver

Solve any 3x3 cube in 22 moves or less, step by step and free. Paint your cube's colors below, then press Solve.

White on top, green facing you

Front face

Or type a scramble

Pick a color, then click the stickers to match your cube.

How to Use the Rubik's Cube Solver

The solver needs the colors of all six sides of your cube. It takes about two minutes to enter them, and the solution appears almost instantly.

  1. Hold the cube with white on top and green facing you. The center stickers never move, so they tell you which side is which. White is the top, green is the front, red is on the right, orange on the left, blue at the back and yellow on the bottom.
  2. Enter the colors. Pick a color in the palette, then click every sticker of that color on the matching side of the net. On a phone, you paint one face at a time in the large grid: tap a face on the net (or use Next face) to choose it. The count under each color shows how many are left. Each color appears exactly nine times. Look at the top face as if the green side is at the bottom of it, and look at the bottom face as if green is at the top.
  3. Press Solve. The solver checks that your cube is possible, then finds a short solution.
  4. Follow the moves one at a time. Keep the cube in the same position (white on top, green in front) and do each move as the 3D cube shows it. Use ◀ and ▶ to step back and forth, or press Play to watch the whole solve.

No cube in your hand? Press Random scramble to see how it works, or type a scramble like R U R' U' under Or type a scramble.

What the Moves Mean (R, U, F and the ' and 2)

Each letter is one face of the cube, and the solver turns that face a quarter turn. A letter on its own means clockwise as you look straight at that face. An apostrophe (') means counterclockwise, and a 2 means turn it twice.

MoveFaceWhat to do
RRightTurn the right side away from you (the front stickers go up)
LLeftTurn the left side toward you (the front stickers go down)
UUp (top)Turn the top layer to the left (the front stickers go left)
DDown (bottom)Turn the bottom layer to the right
FFrontTurn the front face clockwise, like a steering wheel to the right
BBackTurn the back face clockwise as seen from behind (the top goes to the left)

So R' is the right face turned toward you, and U2 is the top layer turned twice, in either direction. Every move in the solution also has a plain-English caption under the 3D cube. See the full Rubik's Cube notation guide for wide moves, slices and rotations.

"This Cube Can't Be Solved": What It Means and How to Fix It

A scrambled cube that came straight from twisting can always be solved. If the solver says your cube is impossible, either a color was entered wrong or the cube was taken apart at some point. The message tells you which of these it is:

How the Solver Finds a Solution in 22 Moves or Less

A Rubik's Cube has about 43 quintillion (43,252,003,274,489,856,000) positions. Checking them one by one would take forever, so the solver uses the two-phase algorithm developed by Herbert Kociemba. In the first phase, it twists the cube into a special group of positions that can be finished using only half turns of the sides and any turns of the top and bottom. In the second phase, it solves the cube from there. Lookup tables built in your browser tell the search how far each position is from those goals, so it can skip almost every dead end.

The solver then keeps searching for a moment longer to see whether a shorter solution exists. Any position can be solved in 20 moves or fewer (mathematicians proved this limit, called God's number, in 2010). This solver usually lands between 18 and 21 moves, which is close to that limit and far shorter than the 100 or more moves a beginner method uses.

We tested the solver on 10,000 random cubes. Every solution was checked by replaying it. The average was 19.85 moves, and the longest was 22.

Everything runs in your browser. Your cube's colors are never sent anywhere.

Want to Solve It Yourself?

The solver gets your cube back to solved, but learning to do it yourself takes about an hour with the beginner method. You need around six short move sequences, and you'll never need a solver again. Start with how to solve a Rubik's Cube, step by step. For something quicker, try a few Rubik's Cube tricks: patterns like the checkerboard take only a handful of moves from a solved cube.

Rubik's Cube Solver FAQ

Is the solver free?

Yes. There's no app to install, no account and no limit on how many cubes you solve.

Why doesn't it just undo my scramble?

The solver only sees the colors, not the moves that mixed them up, and it doesn't need them. It finds its own short route back to solved, which is usually much shorter than the scramble.

Is the solution the shortest possible?

Usually not quite. The shortest solution is often one or two moves shorter, but finding it can take minutes. A two-phase solution of 22 moves or less arrives in under a second and is just as easy to follow.

Can it solve a 2x2, 4x4 or other puzzles?

This page solves the standard 3x3 cube. For a 2x2, use the 2x2 solver, and for a Pyraminx, the Pyraminx solver. For bigger cubes, use the 4x4 solver or the 5x5 solver.

Does it work on my phone?

Yes. Tap a color, then tap the stickers. Once the page has loaded, it doesn't need a connection to solve.