BugHunt

Python visualizer

Paste your code and watch it run, one line at a time, with every variable at every step. Seeing the exact moment a value goes wrong is usually faster than reading the code again.

Runs in your browser. Nothing is uploaded.

Press Visualize execution to watch this run one line at a time, with every variable at every step.

How it works

Python runs through WebAssembly inside your own browser tab — there is no server, so your code is never uploaded and there is nothing to install or sign up for. The first run downloads the Python runtime; after that it is instant.

Execution is traced with sys.settrace, which records every line as it runs along with the variables in scope. Your own functions are traced too; library internals are filtered out so the trace stays readable.

Why step through code?

Reading code tells you what you think it does. Watching it run tells you what it actually does. Most bugs live in that gap — a loop that runs one time too many, a variable that never changes, a value that is None long before it crashes anything.

If you find yourself here often, the pattern behind your bug is usually more useful than the fix. Read about the common ones or practise finding them.

Does it work with input()?

Yes. If your code calls input(), a box appears where you supply one answer per line, handed to the program in order. When they run out Python raises EOFError, exactly as it would if you pressed Ctrl-D in a terminal. The value that was read is shown on the step that consumed it.

Why is my code giving the wrong output with no error?

A wrong answer with no exception is usually a logic error — a loop that runs one time too many, an inverted condition, or a value that was never updated. Stepping through shows the exact step where a variable stops matching what you expected, which is normally faster than reading the code again.

Is my code sent to a server?

No. Python is compiled to WebAssembly and runs entirely inside your browser tab. Nothing you paste leaves your machine.

Limits

Tracing stops after 5,000 steps, which is generous for normal code and stops an infinite loop from hanging the tab. JavaScript is not supported yet.