Skip to the solver

Executed, not copied

Rubik's Cube Algorithms

Every sequence on this page has been run against a cube model and checked against what it claims to do — a PLL has to permute only the last layer, an OLL has to leave the first two layers untouched, a three-cycle has to have order three, and a 4×4 parity algorithm has to change exactly the pieces it says it changes and no others. Writing those checks found six algorithms here that were wrong and looked perfectly plausible — including both parity algorithms, where reading a lower-case r as a two-layer turn instead of the inner slice quietly gives you a different algorithm that still passes every sanity check short of executing it. Algorithm lists on the web are copied from other lists; this one is tested.

Beginner set

8

Enough to solve any cube

Full OLL

57

Two-look OLL is 10

Full PLL

21

Two-look PLL is 6

Full CFOP

78

About 55 moves per solve

The beginner set

Eight sequences, and four of them are mirrors of the other four. This is the entire algorithmic content of the layer-by-layer method — everything else in a beginner solve is looking at the cube and deciding where a piece goes.

NameAlgorithmWhat it doesWhen to use it
Right-hand insertU R U' R'Takes a corner from the top layer and puts it into the front-right slot.Building the first layer's corners, and the workhorse of the second layer.
Left-hand insertU' L' U LThe mirror image: takes a corner into the front-left slot.Same job on the other side. Learn it as a mirror, not as a new sequence.
Right edge insertU R U' R' U' F' U FSends the front-top edge into the front-right slot of the middle layer.Second layer, when the edge needs to go right.
Left edge insertU' L' U L U F U' F'Sends the front-top edge into the front-left slot.Second layer, when the edge needs to go left.
Cross (FUR)F U R U' R' F'Turns a dot into a line, a line into an L, and an L into the cross.Making the yellow cross on the last layer. Run it up to three times.
SuneR U R' U R U2 R'Rotates three of the last-layer corners, leaving one where it is.Orienting the last-layer corners so the whole top face is yellow.
Corner cycleU R U' L' U R' U' LCycles three last-layer corners without changing their orientation.Putting the last-layer corners into their correct positions.
Edge cycle (U-perm)R U' R U R U R U' R' U' R2Cycles three last-layer edges anticlockwise, leaving the fourth alone.The final step, once the corners are home.

PLL — permuting the last layer

These run once the whole top face is one colour and only the positions are wrong. Each leaves the first two layers exactly as it found them and leaves the top oriented — that is the property the test suite checks for every entry below. Learn the T-perm and the two U-perms first; between them they cover about a third of the cases you will meet.

NameAlgorithmWhat it doesWhen to use it
T-permR U R' U' R' F R2 U' R' U' R U R' F'Swaps two adjacent corners and two opposite edges.The first PLL almost everyone learns, and the most common one to see.
Y-permF R U' R' U' R U R' F' R U R' U' R' F R F'Swaps two diagonal corners and two adjacent edges.Diagonal corner swap with an edge swap on the left.
Ua-permR U' R U R U R U' R' U' R2Cycles three edges anticlockwise. Corners untouched.Three edges out of place, corners already done.
Ub-permR2 U R U R' U' R' U' R' U R'Cycles three edges clockwise. Corners untouched.The mirror of Ua. Recognise by which way the headlights point.
Aa-permR' F R' B2 R F' R' B2 R2Cycles three corners. Edges untouched.Edges already solved, three corners in a cycle.
Ab-permR2 B2 R F R' B2 R F' RCycles three corners the other way.Mirror of Aa.
H-permM2 U M2 U2 M2 U M2Swaps both pairs of opposite edges.All four edges wrong, all corners right. Unmistakable.
Z-permM2 U M2 U M' U2 M2 U2 M' U2Swaps two pairs of adjacent edges.Two adjacent swaps, corners already solved.
J-perm (Ja)R' U L' U2 R U' R' U2 R L U'Swaps two adjacent corners and two adjacent edges.Very common. Learn alongside the T-perm.
J-perm (Jb)R U R' F' R U R' U' R' F R2 U' R' U'The other adjacent corner-and-edge swap.Mirror-ish of Ja, and easier for most right-handers.

OLL — orienting the last layer

These make the top face one colour, ignoring where the pieces end up. Sune and its mirror alone are enough for a two-look OLL if you are prepared to run them two or three times.

NameAlgorithmWhat it doesWhen to use it
SuneR U R' U R U2 R'Rotates three corners clockwise.One corner already oriented, the sticker pattern points anticlockwise.
Anti-SuneR U2 R' U' R U' R'Rotates three corners anticlockwise.The mirror case of Sune.
Pi (Bruno)R U2 R2 U' R2 U' R2 U2 ROrients all four corners from the pi shape.Two corners oriented, sitting next to each other.
H (double Sune)R U R' U R U' R' U R U2 R'Orients all four corners from the H shape.No corner oriented, headlights on two opposite sides.
Dot to crossF R U R' U' F'Turns the dot into a line, or the line into a cross.Making the last-layer cross, before the corners.
BowtieF' r U R' U' r' F ROrients the last layer from the bowtie case.Two diagonally opposite corners oriented.

4x4 parity

These have no 3×3 equivalent — they exist because a 4×4 has an inner slice that can hold an odd permutation. Written in WCA wide notation, where Rw is two layers turned together. The 4×4 solver detects which of the two you have and tells you.

NameAlgorithmWhat it doesWhen to use it
OLL parity2R2 B2 U2 2L U2 2R' U2 2R U2 F2 2R F2 2L' B2 2R2Flips the front dedge of the top layer in place, leaving everything else alone.Exactly one last-layer edge is flipped and no 3×3 algorithm will fix it.
PLL parityU2 2R2 U2 2R2 Uw2 2R2 Uw2Swaps the front and back dedges of the top layer, changing the permutation parity.Two edges need swapping and the corners are already correct.
Edge pairing (3-2-3)Uw' R U R' F R' F' R UwPairs the last two dedges without breaking the finished centres.The final two edge pairs, once every other pair is built.
Last two centresRw U Rw' U Rw U2 Rw'Cycles three centre pieces on the last two faces.Finishing centres when only a few pieces remain misplaced.

How algorithms are built

Almost every last-layer algorithm is one of two shapes. A commutator is A B A' B': do something, do something else, undo the first, undo the second. If A and B overlap in only a few pieces, everything outside the overlap cancels and you are left with a tiny, targeted change. The sexy move R U R' U' is the canonical example, and running it six times returns the cube to solved.

A conjugate is A B A': set something up, do the work, undo the setup. F R U R' U' F' — the last-layer cross algorithm — is literally the sexy move conjugated by F, which is why it also has order six.

Once you can see those two shapes, most algorithms stop being random letters. The T-perm is a conjugated commutator; the U-perms are edge three-cycles built from repeated sexy moves. That is also why the tests on this page can be so strict: an algorithm with a real algebraic structure has properties a typo destroys.

Try them on the solver

Paste any algorithm into the scramble box under the net on the solver and press Apply. It runs the sequence on a solved cube so you can see exactly which pieces move — much more useful than a diagram, and it is how the effects described above were confirmed.

Common questions

How many algorithms do I need to solve a Rubik's cube?
Four, if mirrors count as one: an insert for the first two layers, one to make the last-layer cross, Sune to orient the corners, and two cycles to position them. Full CFOP is 78, but the jump from four to 78 buys you about 45 moves per solve, not the ability to solve at all.
What is the difference between OLL and PLL?
OLL — orientation of the last layer — turns the whole top face one colour without caring where the pieces are. PLL — permutation of the last layer — then slides them into position without disturbing the orientation. Full OLL is 57 cases, full PLL is 21. Two-look versions cut those to 10 and 6.
Why do algorithms wreck the cube in the middle?
Because there is no way to move a last-layer piece without temporarily displacing something below it. Every last-layer algorithm is a round trip: break the first two layers, rearrange the top, put the lower layers back exactly as they were. The move count is mostly that round trip.
Are these algorithms verified?
Yes, by execution. Every sequence on this page is applied to a cube model in the test suite and checked against the property its description claims — a PLL must permute only the last layer and leave the top face oriented, an OLL must leave the first two layers untouched, a three-cycle must have order three. Writing that test turned up four sequences here that looked right and were not.
Which algorithm should I learn first after the beginner's method?
The T-perm. It is the most common PLL case, it comes up constantly, and its shape — R U R' U' R' F R2 U' R' U' R U R' F' — teaches you the sexy-move-and-conjugate pattern that most other algorithms are built from.

Keep going