Python Code Runner
Write Python, press Run and see the output of print() beside your code. The interpreter is real CPython compiled to WebAssembly and it runs in your browser, so there is nothing to install and your code is not sent anywhere.
- Runs in your browser
- No sign-up
- Free to use
Standard input for input()
A browser cannot pause the program to ask you a question, so type the answers here before you run it.
Python runs inside your browser through WebAssembly. The runtime, about 12 MB, is downloaded the first time you press Run. Only the standard library is available, and nothing is sent to a server.
How to use Python Code Runner
- Type or paste Python code, or choose one of the examples.
- If the program calls input(), open “Standard input” and enter one line per call.
- Press Run, or Ctrl + Enter. The first run downloads the Python runtime.
- Read the output and any traceback, fix the code and run again.
Python Code Runner features
Real Python 3
CPython itself, compiled to WebAssembly by the Pyodide project. Language behaviour matches a normal installation.
Standard library included
json, re, math, datetime, collections, itertools, dataclasses, statistics, random and the rest of the standard library.
Clean tracebacks
Errors show the frames of your code with line numbers, and the failing line is marked in the editor.
input() support
Lines from the Standard input box are fed to input() in order.
Shell-style results
The value of the last expression is displayed, as in the interactive Python shell.
Time limit
A program that runs too long is terminated, and the page never freezes.
When to use Python Code Runner
- Learning Python on a computer, tablet or school laptop where nothing can be installed.
- Testing a snippet before adding it to a project.
- Checking how a standard library function behaves.
- Working through exercises that read input and print results.
Python Code Runner FAQ
Is this real Python or an imitation?
Real. Pyodide is the reference CPython interpreter compiled to WebAssembly. The version is printed in the output pane on the first run. Syntax, built-in functions and the standard library behave as they do on a desktop installation.
Is my code sent to a server?
No. The interpreter is downloaded to your browser and your code runs there, in a background worker. The server only delivers the runtime files.
Can I use numpy, pandas or requests?
No. Only the standard library is included, to keep the download reasonable and the tool self-contained. Network access is also disabled inside the runner, so packages cannot be installed at run time.
How does input() work?
A browser worker cannot stop and wait for typing, so input is prepared in advance. Enter one line for each input() call in the Standard input box. If the program asks for more lines than you provided, Python raises EOFError.
Why is the first run slow?
The runtime is roughly 12 MB and has to be downloaded and started once. Your browser caches it, and later runs on this page start almost immediately. After a timeout or Stop, the runtime is restarted, which takes a few seconds.
What are the limits?
There is a time limit you can raise to 60 seconds, an output cap of a few thousand lines, and no access to files on your device, to the network, or to threads and subprocesses. Pure computation, text processing and data structures work normally.
Python in a browser tab
For most of its history, running Python online meant sending your code to a server, which executed it in a container and sent the output back. That works, but it is costly to operate safely, adds a delay to every run, and means your code leaves your device. WebAssembly changed the picture. It is a compact binary format that browsers execute at near-native speed, and programs written in C can be compiled to it. CPython, the standard Python interpreter, is written in C.
The Pyodide project did exactly that. It compiles CPython and its standard library to WebAssembly and adds a bridge between Python and JavaScript. The result is a full interpreter that a web page can download like an image and run locally. This tool loads it into a Web Worker, a background thread, so that even a heavy computation leaves the page responsive. Output written by print() is passed to the page line by line and displayed as plain text.
Isolation is handled in two layers. WebAssembly code runs in the browser's sandbox and has no direct access to your files or system. On top of that, once the runtime is loaded, the worker's network and storage functions are removed, so Python code has no way to make requests. If a program exceeds the time limit, the page terminates the worker, which ends execution unconditionally; a fresh runtime is started for the next run.
There are differences from a desktop installation that are worth knowing. Execution is somewhat slower than native Python, typically by a factor of two to three for pure Python code. There are no threads, subprocesses or sockets. The file system is a temporary one in memory: you can create and read files during a run, and they vanish afterwards. For learning the language, practising algorithms and testing snippets, none of this gets in the way.