Paste your push_swap output in the Instructions tab, or record moves with the operation buttons.
Instructions 0
Apply an operation to the stacks and append it to the list.
Push
Swap
Rotate
Reverse rotate
One instruction per line
Stacks
Stack A0
Stack B0
Stack A is empty
Generate random numbers or paste your own in the Generate section on the left.
Push Swap Visualizer: see what your sorting algorithm actually does
The Push Swap Visualizer is an interactive tool for developers, students and coding enthusiasts working on the push_swap sorting algorithm in C. It animates, step by step, how numbers move between two stacks (A and B) using the project's fixed set of operations.
Features
Step-by-step execution: watch the sort unfold one instruction at a time.
Playback controls: play, pause, step back or forward, and change the speed.
Custom input: enter your own numbers to see how your algorithm handles edge cases.
Built for learning: made for students on 42 School's push_swap project and anyone into algorithmic problem-solving.
Why visualize push_swap?
Push swap is hard to reason about without seeing it. A visualizer helps you:
Understand the logic behind push (pa, pb), swap (sa, sb, ss) and rotate operations.
Spot inefficient moves in your sorting implementation.
Debug faster and bring down the number of moves.
Made for 42 School projects
If you're working on the push_swap project at 42 School, this tool helps you build an efficient algorithm while minimizing the number of moves, a key factor in your grade.