Developer

Python Online Compiler

Run Python 3 code in your browser via Pyodide — no install, no server.

Loading interactive tool…

Embed this tool on your site

About this tool

Python Online Compiler lets you write and run Python 3 code directly in your browser, powered by Pyodide 0.25.1 — CPython 3.11 compiled to WebAssembly. There is nothing to install and no account required. Your code is not sent to a server; it runs inside the page itself. On first use, Pyodide downloads around 10 MB from jsDelivr, which the browser caches. Standard library modules work as expected, and bundled packages such as NumPy and Pandas load with await pyodide_js.loadPackage(...); pure-Python wheels from PyPI install through micropip once it is loaded. Plots are not displayed and Python networking libraries such as requests cannot open sockets. Standard output and error messages appear in the Output panel after the run finishes, with errors in red. Code runs on the page's main thread, so a long or infinite loop freezes the tab. This tool suits learners, educators, interviewers and developers who need to test a Python snippet without leaving the browser.

Why use it

  • Zero install — runs CPython 3.11 in WebAssembly with no server, no Docker, no virtualenv setup.

  • Private by default — code and data stay in your browser tab

  • Bundled scientific packages (NumPy, Pandas and more) load on demand

  • Fast after first load — Pyodide is cached by the browser

  • Works on any modern desktop or mobile browser

How to use

  1. Type or paste Python 3 code into the editor — Tab inserts two spaces.
  2. Click Run Python or press Ctrl/⌘ + Enter — Pyodide loads on first use (approx 10 MB, then cached by your browser).
  3. Standard output and errors appear in the Output panel when the run finishes.
  4. Load the package installer first: import pyodide_js; await pyodide_js.loadPackage('micropip'). Then import micropip and use await micropip.install('packagename').
  5. Click Clear to reset the Output panel without losing your code, or Copy output to copy it.

When it helps

  • Testing a quick Python snippet without opening a terminal or activating a virtualenv
  • Learning Python or following along with a tutorial
  • Technical interviews where a shareable Python environment is needed
  • Prototyping data transformation logic before adding it to a project
  • Teaching Python in a classroom with no local setup

Examples

FizzBuzz

Input
for i in range(1, 16):
    if i % 15 == 0: print('FizzBuzz')
    elif i % 3 == 0: print('Fizz')
    elif i % 5 == 0: print('Buzz')
    else: print(i)
Expected result · Scroll for more
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz

JSON parse and aggregate

Input
import json
data = '[{"city":"NYC","pop":8.3},{"city":"LA","pop":3.9}]'
rows = json.loads(data)
total = sum(r['pop'] for r in rows)
print(f'Total population: {total:.1f}M')
Expected result
Total population: 12.2M

Load NumPy and compute mean

Input
import pyodide_js
await pyodide_js.loadPackage('numpy')
import numpy as np
arr = np.array([10, 20, 30, 40, 50])
print('Mean:', arr.mean(), 'Std:', arr.std().round(2))
Expected result
Mean: 30.0 Std: 14.14

Tips

  • Top-level await works in this editor. To load a bundled package, import pyodide_js and call await pyodide_js.loadPackage('numpy') before importing it.
  • Pre-bundled scientific packages (numpy, pandas, scipy) install much faster than pure-Python wheels from PyPI.
  • For PyPI packages, first load micropip with await pyodide_js.loadPackage('micropip') after importing pyodide_js. Then import micropip and use await micropip.install('package==version') to pin a version.
  • The console updates when a run finishes. Split a long computation into smaller runs when you need to inspect intermediate results.
  • Avoid deeply recursive code — WebAssembly stack limits are tighter than CPython's default 1000-frame limit.
  • For large inputs, paste data into a triple-quoted string rather than reading from a file — there is no host filesystem.
  • Use json.dumps(obj, indent=2) for readable output when inspecting nested dicts or API response shapes.

Frequently Asked Questions

Which Python version is used?
Pyodide bundles CPython 3.11. Most standard library modules behave exactly as they do in a local Python installation.
Can I use NumPy or Pandas?
Yes. Run import pyodide_js and then await pyodide_js.loadPackage("numpy") (or "pandas") before importing it. micropip is not loaded by default, so a plain import micropip fails until you load it the same way.
Is my code sent to a server?
No. Pyodide is a WebAssembly port of CPython that runs entirely in your browser tab. Nothing is transmitted to any server.
Why does the first run take a while?
Pyodide downloads approximately 10 MB of WebAssembly assets on first use. The browser caches these files, so subsequent runs start immediately.
What are the limitations compared to desktop Python?
File I/O, raw network sockets, subprocess calls, and threading behave differently inside WebAssembly. Matplotlib figures are not shown in the output panel. Most algorithmic, data-processing, and pure-Python code works fine.
Can I run infinite loops or blocking code?
Avoid true infinite loops — they will hang the browser tab. Use a loop with a break condition or a limited iteration count when testing iterative code.

Explore the category

Glossary

Pyodide
A port of CPython 3.11 to WebAssembly maintained by the Python community, enabling Python execution inside a browser tab without a server.
WASM (WebAssembly)
A portable binary instruction format that runs in browsers at near-native speed and is sandboxed from the host system.
Micropip
Pyodide's lightweight package installer that loads pure-Python wheels from PyPI or pre-built scientific packages from the Pyodide CDN.
REPL
Read-Eval-Print Loop — an interactive shell where each expression is immediately evaluated and printed; this tool acts as a script-style REPL.
Main thread
The browser thread that also draws the page and handles clicks. Pyodide runs there in this tool, so heavy computation pauses the page until it finishes.
AST (Abstract Syntax Tree)
A tree representation of Python source code that the interpreter builds before execution; you can inspect it via the ast module.
Wheel (.whl)
A pre-built binary distribution format for Python packages; micropip installs wheels rather than building from source.
Standard library
Modules shipped with CPython itself (json, re, math, etc.) that work in Pyodide without any package install.
A LITTLE HELP. A LOT DONE.
Good tools.
Great flow.

Your shortcut to the everyday. Create, convert, calculate,
and get back to what you love.

✓ Free to use✓ No sign-up✓ 500+ possibilities