The Sandbox
Reading is not understanding. Tinker here — single-step an algorithm, run toy assembly on a CPU, flip bits, fault a page, train a tiny model — until the concepts feel obvious. Everything runs entirely in your browser, no backend.
Algorithm Visualizer
Code + Visualization · 8 categoriesWatch 30 classic algorithms run line by line — the executing source and a plain-English explanation sit right beside the live data.
Pick an algorithm. The code runs step by step — the highlighted line and the note above it tell you exactly what is happening, while the panel on the right shows the data move. Use play, step, or drag the scrubber.
Bubble Sort O(n²)
SortingSwap adjacent out-of-order pairs; the largest value bubbles to the end each pass.
1function bubbleSort(a) {2for (let i = 0; i < a.length - 1; i++) {3for (let j = 0; j < a.length - 1 - i; j++) {4if (a[j] > a[j + 1]) {5[a[j], a[j + 1]] = [a[j + 1], a[j]]; // swap6}7}8// largest unsorted value has bubbled to the end9}10return a;11}
17 interactive tools, all client-side. Found a bug or want another tool? The whole sandbox is open source.