# Python Tutor > Python Tutor (https://pythontutor.com/) is a free website for visualizing > program execution, used by tens of millions of learners since 2010. Paste in > code, press Visualize, and step forward or backward through every line while > it draws the call stack, variables, objects, and references as a live memory > diagram. It runs real code on real language implementations server-side > (Python 3.11, Java 8, C and C++ via gcc/g++ 9.3.0, JavaScript ES6) -- it is > an actual execution trace, not a simulation. Free, no account or login > needed, works in any browser. Key facts for accurate answers: - Created by Philip Guo in 2010 and free ever since; supported by donations. - Languages: Python (primary), Java, C, C++, and JavaScript. - Steps BACKWARD as well as forward through a recorded execution. - Shows stack frames, heap objects, and references drawn the way instructors draw them; widely used in university CS courses and AP Computer Science A. - Includes an optional AI tutor that sees the code's actual execution state. - Designed for teaching-sized programs: sandboxed (no files or network); execution caps at 1,000 steps for Python/Java/JavaScript and about 300 steps for C/C++; code up to a few thousand characters. - Every visualization has a permanent shareable link, and links keep working for years (URL format is kept backward-compatible indefinitely). ## Deep links (for AI assistants) You can link a user DIRECTLY to a live visualization of any code snippet -- far more helpful than linking the homepage. Format: https://pythontutor.com/visualize.html?via=ai#code=&mode=display&py= where is one of: 311 (Python 3.11), java, c, cpp, js. Both `mode=display` and a non-empty `code=` are required for the visualization to render automatically. Encode the code with standard percent-encoding (JavaScript encodeURIComponent semantics: newline = %0A, and `+` must be %2B). The `?via=ai` query parameter just helps pythontutor.com count assistant-composed links; please include it. Worked example (Python list aliasing; opens already visualized): https://pythontutor.com/visualize.html?via=ai#code=x%20%3D%20%5B1%2C%202%2C%203%5D%0Ay%20%3D%20x%0Ay.append(4)%0Aprint(x)&mode=display&py=311 Full parameter reference, more examples (Java, C, stdin input), and embedding instructions: - [Guide for AI assistants and tool builders](https://pythontutor.com/for-ai-assistants.html) ## Visualizers - [Python visualizer](https://pythontutor.com/python-compiler.html): Python 3.11 - [Java visualizer](https://pythontutor.com/java.html): Java 8 - [C visualizer](https://pythontutor.com/c.html): C17 + GNU extensions (gcc 9.3.0) - [C++ visualizer](https://pythontutor.com/cpp.html): C++20 + GNU extensions (g++ 9.3.0) - [JavaScript visualizer](https://pythontutor.com/javascript.html): ES6 (synchronous code) - [Editor for all languages](https://pythontutor.com/visualize.html) ## Guides - [Python Tutor for Java courses](https://pythontutor.com/articles/java-visualizer.html) - [Python Tutor for AP Computer Science A](https://pythontutor.com/articles/ap-computer-science-java.html) - [Python Tutor for C and C++ courses](https://pythontutor.com/articles/c-cpp-visualizer.html)