About this Python visualizer
This Python visualizer runs your program one line at a time and shows what happens at every step: which line is running, the value of each variable, which functions are on the call stack, and the output printed so far. You can go forward and backward as often as you like.
It is built for learning. Watching a loop change a variable, or a recursive function add a new frame for every call, makes it much easier to see how a program really works. Everything runs in your browser, so there is nothing to install and no account to create.
How to use it
- Type or paste your Python code in the editor. The example on this page shows a loop and a recursive function.
- If your program uses input(), type the values in the Input box below, one per line.
- Press Visualize. The first time, the Python runtime downloads (about 10 MB, then it is kept by your browser).
- Use the arrows, the slider, or the Left and Right keys to move through the steps. The highlighted line is the one about to run, and changed variables are marked.
Features
- Step forward and backward through every line of your program
- See variables for the global scope and for every function call on the stack
- Values that just changed are highlighted
- Output appears exactly when the program prints it
- Errors show the line that caused them
- Free, no login, works on phones and computers
Good to know
- Recording stops after 1,000 steps, so very long loops are cut short and endless loops cannot freeze the page.
- Only your own code is stepped through, not the inside of imported libraries.
- Long values (big lists or strings) are shortened so the screen stays readable.
- Objects are shown as text, not as boxes with arrows yet.
- Programs that need files, the network or threads will not work, as in the Python compiler.
Frequently asked questions
What is a Python visualizer?
It is a tool that runs your code step by step and shows the state of the program at each step, mainly the variables and the call stack. It helps you understand what the code does instead of only seeing the final output.
Does it run my code on a server?
No. Your program runs inside your browser using Python compiled to WebAssembly, and it is not sent anywhere.
Why did it stop after 1,000 steps?
A limit keeps the page fast and stops endless loops. Try a smaller input or fewer iterations to see the whole run.
Can I use input()?
Yes. Type the values in the Input box, one per line, before you press Visualize. The echoed values appear in the output.
Is it free?
Yes. There is no sign-up and no limit on how often you use it.
Just want to run your code?
Use the online Python compiler to run a program and see its output straight away.