Python Playground
Write, run and debug real Python 3 in your browser, even offline.
Runs in your browser — nothing is uploaded
Press Debug to record a run, then step through it.
Call stack
Variables
| Name | Type | Value |
|---|
Output so far
Real Python, in the page
This playground runs CPython 3.14 compiled to WebAssembly, so the language is exactly the Python you write everywhere else. Modern features are all here: structural pattern matching with match and case, async and await with asyncio.run and asyncio.gather, the walrus operator, dataclasses with slots, f-strings, type hints with the new generic syntax such as def first[T](items: list[T]) -> T and type aliases, and exception groups caught with except*.
Python runs in a background worker, so a slow program never freezes the page, and Stop ends even an infinite loop straight away. Each run starts from a clean slate, with no variables carried over from the last one.
Step through your code
Press Debug and the program runs once while every step is recorded. The editor highlights the line about to run, with the previous line shaded so you can see where execution came from. The call stack lists every active function, and selecting a frame shows its variables with their types and values. Values that changed since the last step are highlighted.
Because the whole run is recorded, you can step backwards as easily as forwards, which makes it easy to find where a value went wrong. Click beside a line number to set a breakpoint, then jump straight to it. For example, debug a recursive factorial(5) and watch five frames build up on the stack, then return 1, 2, 6, 24 and 120 as they unwind.
An editor that helps
The editor colours Python syntax, indents after a colon, matches brackets, folds blocks and supports multiple cursors, search and undo. Autocompletion comes from Jedi, the engine used by many Python editors: type "hello".up and it suggests upper with its signature and documentation, or from collections import de to get defaultdict and deque. Syntax errors are underlined as you type.
Copy and paste work as normal, and there are buttons to copy the code or the output, download your program as a .py file, or open one from disk. Your current code is saved in your browser automatically.
Good for practice
Use it to try out an idea, check how a built-in behaves, or practise for an interview without installing anything. The Examples menu has short programs that show off each modern feature, and every one of them can be run or debugged as a starting point for your own.
How to use
- Type or paste Python, or pick an example.
- Press Run (Ctrl/Cmd+Enter) to see the output.
- Press Debug to step through the program and inspect variables.
FAQ
Is this real Python?
Yes. It is CPython 3.14, the standard Python interpreter, compiled to WebAssembly by the Pyodide project. The standard library is included, so modules such as json, re, datetime, dataclasses, itertools and asyncio behave exactly as they do on your machine.
Does it work offline?
Yes, after one visit. The first time you open the playground your browser downloads Python (about 8 MB) and keeps it. From then on the page, the editor, running, debugging and autocompletion all work with no connection. The status bar shows "Available offline" once everything is stored.
Is my code uploaded?
No. Your code runs in a background worker in this browser tab and is saved only in your browser's local storage so it survives a reload. Nothing is sent to a server.
How does the debugger work?
Debug runs your program once and records every step: the current line, the call stack and each variable's value. You can then step forwards and backwards, drag the slider to any point, or set breakpoints by clicking beside a line number and jump between them. Recording stops after 10,000 steps, so a loop that never ends still gives you a recording to step through. If a single step never finishes, such as one enormous calculation, press Stop to end the rest.
Can I install packages with pip?
No. The playground is designed to work offline, so it cannot download packages. Everything in the standard library is available.
How do I use input()?
Type the answers into the stdin box, one line per input() call, before you press Run. If the program asks for more lines than you provided, it raises EOFError and tells you to add more.
What doesn't work?
Anything that needs the operating system or the network: threads, multiprocessing, subprocesses, sockets and HTTP requests. Programs that never finish can be stopped with the Stop button.