How the Rubik's Cube Solver and Timer Work

After reading this you will understand cube notation, the layer-by-layer method the solver uses, why its solutions run long, and how speedcubing averages are computed so you can read your own times honestly.

What this tool does and one quick example

The tool gives you three things in one place: a 3D cube you can turn, a solver that untangles any position and narrates each stage, and a timer that runs proper speedcubing sessions. You can scramble, watch the solution play back move by move, then race yourself against a rolling average.

Here is the hook. A single scramble like R U R' U' looks trivial, but apply it six times and the cube returns to solved. That is because R U R' U' has order 6: the permutation it performs on the pieces cycles back to the identity after 6 repetitions. Twenty-four turns total, and you are back where you started. This is the first hint that a cube is not a pile of stickers but a group of permutations, and every solving method is just a route through that group.

Reading cube notation

Every move names one of the six faces and how far to turn it. A bare letter is a 90-degree clockwise turn of that face, viewed from outside the cube.

R, L
Right and left faces.
U, D
Up and down faces.
F, B
Front and back faces.
Apostrophe (R')
The same face turned counter-clockwise, that is 90 degrees the other way.
Double (R2)
A half turn, 180 degrees. Direction does not matter for a double turn.

Counting matters. R and R' cancel. R2 equals R R equals R' R'. A face has exactly four states (0, 90, 180, 270 degrees), so R R R R is a no-op. Keep this in mind when you read the solver's output: strings of pure quarter turns are where the move count grows.

When to use the solver, and when not to

Use the solver when you are learning, when you want to check that a scramble is genuinely solvable, or when you want to see a named breakdown of the beginner method. Each stage is labelled, so you can pause at "second layer" and study just that.

Do not treat the solver as a speedcubing coach. It follows the layer-by-layer beginner method on purpose. A computer can solve any legal position in 20 moves or fewer (the proven "God's number" for the half-turn metric), but those 20-move solutions are impossible for a human to find at the table. The solver instead produces 60 to 120 moves that a person can actually follow and repeat.

There are exactly 43,252,003,274,489,856,000 reachable positions on a 3x3 cube, about 4.3 \times 10^{19}. God's number says every one of them sits at most 20 half-turns from solved. The beginner method ignores that bound in exchange for a small, memorable set of algorithms.

Why layer-by-layer costs more moves

The beginner method solves the cube in seven stages, each of which never disturbs the parts already finished. That constraint is what makes it learnable, and also what makes it long. To fix one corner in the last layer without breaking the first two layers, you repeat a short trigger several times.

M_{\text{total}} \approx \sum_{s=1}^{7} n_s \cdot \ell_s

Here n_s is how many algorithm applications stage s needs and \ell_s is the length of that algorithm. The last two stages, OLL (orient last layer) and PLL (permute last layer), are the expensive ones: a single PLL case can be 12 to 15 moves, and orienting corners in OLL often means running an 8-move trigger up to three times. Add the stages and you land in the 60 to 120 range.

Typical move cost by stage in the beginner method
StageWhat it fixesTypical moves
CrossFour edges on the bottom6-8
First-layer cornersFour bottom corners10-20
Second layerFour middle edges16-32
Yellow crossTop edges oriented4-12
OLL (corners)Top corners oriented8-24
PLL (permute)Last layer positioned12-30

Reproducing the demo cube

The demo button scrambles with the tool defaults, then you press solve. Follow along with a real position produced by the WCA-style scramble F R U2 L' B2 D F' R2 U' applied to a solved cube.

  1. Apply the 9-move scramble. Nine random-state turns leave the cube far from solved, well beyond what the eye can trace.
  2. The solver builds the cross first. On this position it uses 7 moves to seat the four bottom edges.
  3. First-layer corners follow. Here it inserts four corners with a repeated R U R' U'-style trigger, 18 moves.
  4. Second layer edges take 24 moves across four insertions.
  5. Yellow cross needs one algorithm application, 6 moves.
  6. OLL corners need the 8-move trigger twice, 16 moves.
  7. PLL positions the last layer with a 14-move sequence.

Total: 7 + 18 + 24 + 6 + 16 + 14 = 85 moves. That is squarely inside the 60 to 120 band, and every move is one you could learn in an afternoon. A computer optimal solver would clear the same scramble in 18 or 19 moves that share no visible logic.

How the timer computes averages

Speedcubing does not rank you by a single best solve. It uses trimmed means so one lucky scramble or one fumble cannot dominate. The two standard windows are ao5 (last five solves) and ao12 (last twelve).

\text{ao5} = \frac{1}{3}\sum_{i=2}^{4} t_{(i)}

The times t_{(i)} are the last five solves sorted from fastest to slowest. You drop t_{(1)} (the best) and t_{(5)} (the worst), then average the middle three. The ao12 works the same way but drops the single best and single worst of twelve and averages the middle ten.

Because ao5 trims both ends, chasing a single fast solve barely moves it. To drop your ao5 by one second you must speed up your middle three solves, not set a new personal best. That is the metric doing its job.

Working an ao5 by hand

Suppose your last five solves are 18.4, 15.2, 22.9, 17.1, and 16.8 seconds.

  1. Sort them: 15.2, 16.8, 17.1, 18.4, 22.9.
  2. Drop the best 15.2 and the worst 22.9.
  3. Average the middle three: (16.8 + 17.1 + 18.4) / 3 = 52.3 / 3 = 17.43 seconds.

Your ao5 is 17.43. Notice the raw mean of all five is 18.08, higher, because the slow 22.9 pulls it up. The trim removed that pull.

The raw mean 18.08 sits above the ao5 17.43 because the 22.9 outlier is trimmed out.

With solves 18.4, 15.2, 22.9, 17.1, 16.8 the raw mean is 18.08 and the trimmed ao5 is 17.43. Raising the worst solve from 22.9 toward 30 leaves the ao5 fixed at 17.43 while the raw mean climbs past 19.5, showing that the trim ignores the slowest time entirely.

Common mistakes

Three errors trip up new users.

  • Turning off-axis. An R turn is clockwise as seen from the right side, not from the front. Sighting from the wrong face gives you R' and derails the solver's next step.
  • Peeling stickers to "solve" the cube. That can create an unreachable position. Only 1 in 12 random sticker arrangements is actually solvable, because corner twist, edge flip, and permutation parity are each constrained.
  • Reading the ao5 as your fastest time. It is a trimmed mean, so it will always be slower than your best single and faster than your worst.

If the solver refuses a position, the cube state is illegal, not buggy. A single swapped pair of edges or one twisted corner cannot occur from legal turns and cannot be solved. Reset and rescramble.

Related tools

If you enjoy the counting behind puzzles, the same probability thinking drives card games. The Deck Odds Calculator computes exact draw odds, opening hands, and mulligan math, which is the card-game cousin of counting cube positions.

Frequently asked questions

Why is the solver's solution so much longer than 20 moves?

It uses the human-followable layer-by-layer method, which trades length for learnability. Optimal 20-move solutions exist but no person can find them by inspection. Expect 60 to 120 moves here.

What does ao5 mean exactly?

Take your last five solves, drop the fastest and the slowest, and average the middle three. It is a trimmed mean designed so one great or terrible solve does not decide your result.

Does inspection time count against my solve?

No. The inspection countdown runs before the timer starts. The solve time begins when you release for the first turn, following the standard speedcubing procedure.

Can every scramble be solved?

Every legal scramble can, because turning faces never leaves the solvable subset of positions. Only about one in twelve arbitrary sticker layouts is legal, so a hand-edited cube may be impossible.

Are my times stored anywhere?

Your session history stays on your device. Nothing about your cube or your times is sent off your browser.