Online Python Compiler

Run Python 3.14 (real CPython on WebAssembly) with the standard library and stdin. Your code stays in this browser tab.

Runs in your browser · Nothing uploadedFree · No sign-upPython 3.14

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:

Embed this compiler

Paste this into your page. Visitors run code in their own browser, and nothing is sent to us.

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.

At a glance
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.

FeatureWorks?
input() and sys.stdin.read()

Both read the stdin box. An empty box makes input() raise EOFError.

Yes
Standard library

json, re, datetime, collections, dataclasses, itertools, statistics, decimal, csv, hashlib and the rest. sqlite3 works with :memory: databases.

Yes
time.sleep()

It really waits, so the pause counts toward the 10-second limit.

Yes
Reading and writing files

open() works inside a scratch folder that is deleted when the run ends.

Partly
asyncio.run()

Works in browsers with WebAssembly JSPI support, such as current Chrome and Edge. Elsewhere it raises RuntimeError.

Partly
threading, multiprocessing, subprocess

Starting a thread raises RuntimeError. subprocess raises OSError, because there are no processes to start.

No
pip, NumPy, pandas, requests

Only modules that ship with Python are installed.

No
Network access

urllib and sockets are blocked by the sandbox.

No
tkinter, turtle, curses

There is no window or terminal to draw on.

No
zoneinfo time zones

The time-zone database is not bundled. datetime.timezone.utc and fixed offsets work.

No

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

1

Write your code

Start from the sample, pick an example above the editor, or paste your own script.

2

Add stdin

Put each value your program reads on its own line. Leave the box empty if it reads nothing.

3

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.

Input
nums = list(map(int, input().split())) print(max(nums) - min(nums))
Output
7

Frequently Asked Questions

Which Python version does this compiler use?
Python 3.14.2 on Pyodide 314. It is CPython itself compiled to WebAssembly, so code that runs on a normal 3.14 install runs here too, apart from the limits in the table above.
Why do I get EOFError when I call input()?
Your program asked for more lines than the stdin box holds. The whole box is handed to the program when the run starts, and it cannot ask you for more halfway through. Add a line for each input() call.
Can I use NumPy, pandas or requests?
No. Only the standard library is installed, and the sandbox blocks network access, so requests would fail anyway. For number work, statistics, decimal and fractions are all available.
How do I read input the way coding judges do?
Paste the test case into stdin. Read one line at a time with input(), or everything at once with sys.stdin.read().split(). As on a judge, all of the input is there before the program starts.
Is my Python code sent to a server?
No. It runs in your browser, inside a sandboxed frame and a Web Worker that cannot reach the network. Share links store the code after the # in the URL, and browsers never send that part to a server.
How long can a program run?
10 seconds of run time, not counting the first download. Output stops at 10,000 lines or 1 MB. You can press Stop at any point.

Related Tools

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.

As featured on

CodeItBro - Free dev tools + practical guides to help you ship faster | Product HuntCodeItBro - Free Online Developer Tools badgeCodeItBro badgeFeatured on neeed.directory