Python & JavaScript visualizer
Paste Python or JavaScript 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 and JavaScript runs in a sandboxed worker — there is no server, so your code is never uploaded and there is nothing to install or sign up for. The first Python run downloads the runtime; after that it is instant.
Python is traced with sys.settrace, which records every line as it runs along with the variables in scope. JavaScript has no equivalent, so the source is parsed and a recording call is injected before every statement. Both trace into your own functions; 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.
Can I visualize JavaScript code too?
Yes — switch the language above the editor. Both languages step line by line and trace into your own functions, and console.logoutput is captured the same way Python’s print is.
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. input() is Python-only — JavaScript has no blocking input primitive to supply values to.