Skip to content

Run Python online — no installation

Write Python in the editor and press Run. It executes on your own machine, in this tab, through a real CPython compiled to WebAssembly — so there is nothing to install, no account to make, and your code is never uploaded anywhere.

main.py
Output appears here when you run your code.

Python runs inside this page through WebAssembly. Your code is never uploaded.

What this playground is good for

It is a scratchpad. Checking whether str.removeprefix exists in the version you are targeting, working out the argument order of zip, testing a regular expression, proving to yourself that mutable default arguments really do behave like that — the small experiments that are faster to run than to reason about. The whole standard library that makes sense in a browser is here: json, re, math, random, datetime, itertools, collections, functools, dataclasses, csv, textwrap, decimal, statistics, hashlib and the rest.

It is also a reasonable place to work through an exercise from a book or a course. If you are learning rather than checking, the Python Basics course uses this same runtime with the addition of instructions, tests that mark your work, and hints when you are stuck. Every course on PyLearn is free — no card, no limits.

How the browser runtime differs from Python on your machine

The language is complete — everything about syntax, classes, generators, decorators, exceptions and the data model is identical, because this is the same CPython rather than a lookalike. What differs is the world around it, and the differences are all consequences of the browser sandbox:

  • No access to your files. open() works, but it reads and writes a temporary filesystem inside the tab that vanishes when you close it. Your documents are not visible to it, which is precisely why running unfamiliar code here is safe.
  • No network sockets. requests, urllib, socket, smtplib and every database driver need a TCP connection the browser will not give them. Pages can only make HTTP calls the browser itself permits, and only to servers that allow it.
  • No subprocesses or threads. subprocess, multiprocessing and os.fork have nothing to fork into. There is one process, and it is a browser tab.
  • input() reads from a box, not a prompt. Type the answers into the Input panel before running. The program has no terminal attached to it, so there is nowhere for a prompt to appear.
  • Only packages built for WebAssembly. NumPy, pandas, SciPy and scikit-learn are available; anything with a C extension nobody has compiled for this target is not. Pure-Python packages generally work.
  • It is slower, and there is a memory ceiling. Expect roughly two to five times native speed and a few gigabytes at most. Fine for learning and for scripts; not where you train a model.

Installing Python properly

When you outgrow a tab — when you want to read your own files, call an API, install any package you like, or keep a project around — install Python locally. Download it from python.org, or use brew install python on a Mac and your distribution’s package manager on Linux; on Windows the python.org installer is the simplest route, and remember to tick “Add Python to PATH”. Then use a virtual environment per project (python -m venv .venv) so one project’s dependencies cannot break another’s.

Nothing you write here needs changing to run there. That is the point of it being the same interpreter — a script that works in this tab works on your machine, minus the sandbox limits above.

Where to go next

If you are starting out, Python Basics covers printing, variables, decisions and loops in twelve lessons. If you already write Python and want to work with data, Data Analysis covers NumPy and pandas — both of which run in this playground too. And if you are here because you are building something with a language model, the AI Engineer track starts with calling an LLM API properly and goes through structured output, RAG and evals.

Questions

Is this really Python, or a simulation of it?
It is CPython — the same interpreter you would download from python.org — compiled to WebAssembly through Pyodide. Classes, generators, decorators, comprehensions and the standard library all behave exactly as they do locally, because it is the same implementation rather than a reimplementation.
Do I need an account?
No. There is no signup, no email box and no limit on how many times you can run something. The free course is a separate thing you can ignore entirely.
Is my code sent to a server?
No. The interpreter is downloaded to your browser and your code runs there. Nothing is uploaded, including when you share a snippet — the share link carries the code inside the URL fragment, which browsers never send to a server.
Which Python version is this?
Python 3.14, the version Pyodide currently ships. You can check it yourself by running: import sys; print(sys.version).
Can I use NumPy, pandas or requests?
NumPy and pandas are available and are downloaded on demand the first time you import them, because they are several megabytes and most visitors never need them. Anything requiring a network socket, such as requests, cannot work — see the limits below.
Why can't my program read files from my computer?
The browser sandbox has no access to your filesystem, which is also what makes it safe to run a stranger's code. Python's open() works, but against a temporary in-memory filesystem that disappears when you close the tab.
How do I use input()?
Open the Input box under the editor and type one answer per line before you press Run. There is no interactive prompt, because the program runs in a worker without a terminal attached to it.
What happens if I write an infinite loop?
Press Stop. WebAssembly Python cannot be interrupted from inside itself, so the page terminates the worker and starts a fresh one — the tab stays responsive throughout, and long-running code is stopped automatically after a few seconds.