Online Python Compiler
Run Python 3.14 (real CPython on WebAssembly) with the standard library and stdin. Your code stays in this browser tab.
Start from an example
main.py
Standard input (stdin)
Output
Nothing has run yet
Press Run to see what the program prints, or load one of these:
Real CPython 3.14, running in this tab
This is not a Python look-alike. It is CPython 3.14.2 compiled to WebAssembly by the Pyodide project, so syntax, error messages and the standard library behave the way they do on your laptop.
Nothing runs on our servers. Type your program, put any input in the stdin box and press Run. Each input() call takes the next line, which is also how HackerRank-style judges feed in test data.
- Version
- Python 3.14.2
- Engine
- Pyodide 314 (WebAssembly)
- Input
- stdin box, read with input()
- Packages
- Standard library only
- Run limit
- 10 seconds
- First load
- About 12 MB, then cached
What works and what does not
We ran every row of this table in the compiler before writing it down.
| Feature | Works? | Details |
|---|---|---|
| input() and sys.stdin.read() Both read the stdin box. An empty box makes input() raise EOFError. | Yes | Both read the stdin box. An empty box makes input() raise EOFError. |
| Standard library json, re, datetime, collections, dataclasses, itertools, statistics, decimal, csv, hashlib and the rest. sqlite3 works with :memory: databases. | Yes | json, re, datetime, collections, dataclasses, itertools, statistics, decimal, csv, hashlib and the rest. sqlite3 works with :memory: databases. |
| time.sleep() It really waits, so the pause counts toward the 10-second limit. | Yes | It really waits, so the pause counts toward the 10-second limit. |
| Reading and writing files open() works inside a scratch folder that is deleted when the run ends. | Partly | open() works inside a scratch folder that is deleted when the run ends. |
| asyncio.run() Works in browsers with WebAssembly JSPI support, such as current Chrome and Edge. Elsewhere it raises RuntimeError. | Partly | Works in browsers with WebAssembly JSPI support, such as current Chrome and Edge. Elsewhere it raises RuntimeError. |
| threading, multiprocessing, subprocess Starting a thread raises RuntimeError. subprocess raises OSError, because there are no processes to start. | No | Starting a thread raises RuntimeError. subprocess raises OSError, because there are no processes to start. |
| pip, NumPy, pandas, requests Only modules that ship with Python are installed. | No | Only modules that ship with Python are installed. |
| Network access urllib and sockets are blocked by the sandbox. | No | urllib and sockets are blocked by the sandbox. |
| tkinter, turtle, curses There is no window or terminal to draw on. | No | There is no window or terminal to draw on. |
| zoneinfo time zones The time-zone database is not bundled. datetime.timezone.utc and fixed offsets work. | No | The time-zone database is not bundled. datetime.timezone.utc and fixed offsets work. |
Why run Python here
Tracebacks you can trust
Errors print the same traceback CPython gives you locally, pointing at main.py and the line. The code that wraps your program is cut out of it.
A clean slate every run
Each run gets fresh variables, fresh stdin and an empty scratch folder. Nothing leaks in from the run before.
Slow once, quick after
The first run downloads the interpreter. After that it stays loaded, and a run starts in a few milliseconds.
Endless loops are not fatal
A while True loop does not freeze the page. Press Stop or wait 10 seconds, and the interpreter is shut down and restarted.
Errors you will probably hit
These five cover most first-day problems.
EOFError: EOF when reading a line
What it meansinput() ran out of lines in the stdin box.
FixAdd one line of input for every input() call, then run again.
ModuleNotFoundError: No module named 'numpy'
What it meansThird-party packages are not installed here.
FixUse the standard library, or run the script locally after pip install numpy.
RecursionError: maximum recursion depth exceeded
What it meansMore than 1,000 nested calls.
FixRaise the limit with sys.setrecursionlimit(10_000), or turn the recursion into a loop.
IndentationError: expected an indented block
What it meansThe line after def, if, for or while is not indented.
FixIndent the block. Tab in the editor inserts four spaces.
RuntimeError: can't start new thread
What it meansPython in the browser has no real threads.
FixDo the work in order, or use asyncio when you are waiting on several things.
How this Online Python Compiler works
When you press Run, the page passes your code and stdin to a sandboxed frame that cannot see this site, your cookies or the network. Inside it, a Web Worker runs Pyodide, which is CPython 3.14 built for WebAssembly.
The first run downloads about 12 MB (around 6 MB compressed), which your browser then caches. The interpreter stays loaded between runs, so later runs start almost at once. Every run still gets fresh variables, fresh stdin and its own scratch folder, all thrown away when it finishes.
How to use this Online Python Compiler
Write your code
Start from the sample, pick an example above the editor, or paste your own script.
Add stdin
Put each value your program reads on its own line. Leave the box empty if it reads nothing.
Run it
Press Run Python or Ctrl+Enter. Output, errors, exit code and run time appear on the right.
Example Usage
With 4 9 2 7 in stdin, this prints the gap between the largest and smallest number.
Frequently Asked Questions
Which Python version does this compiler use?
Why do I get EOFError when I call input()?
Can I use NumPy, pandas or requests?
How do I read input the way coding judges do?
Is my Python code sent to a server?
How long can a program run?
Related Tools
Online Syntax Highlighter
Highlight your code with syntax coloring for various languages. Generate HTML with inline styles or classes.
Python Formatter
Format and beautify Python code following PEP 8 standards.
Python Beautifier
Beautify messy Python code with proper indentation.
Regex Tester
Test and debug regular expressions with real-time match highlighting.
Python Dict to JSON
Convert Python dictionaries to valid JSON online. Handles True, False, None, single quotes, and trailing commas automatically.
JavaScript Compiler
Write and run JavaScript online with stdin input, exit codes and instant output. It runs in a sandbox in your browser, so your code is never uploaded.
Comments
Comments are provided by Disqus, which sets cookies and processes data under its own privacy policy.
The Online Python Compiler is maintained by CodeItBro. We aim to provide the best free developer tools on the web. If you have feedback or suggestions, please visit our contact page.

