Online Python compiler
Write Python 3, press Run. Real CPython runs in your browser, so there’s no signup, no queue and your code never leaves your device.
name = "world"
print(f"Hello, {name}!")
for i in range(1, 4):
print(f"{i} squared is {i * i}")
Run Python online, no install
The editor above is a full Python 3 environment: loops, classes, generators, async, f-strings, the match statement and the standard library all work. Tab indents, Enter keeps your indentation, and Ctrl/⌘ + Enter runs the code.
Stuck on an error? Press Fix the error and the AI reads your code together with the traceback, explains what went wrong and offers corrected code you can drop back into the editor.
What works and what doesn’t
- Works: the standard library,
input()through the stdin box, files written and read in the same run (an in-memory filesystem), recursion, long loops (up to 20 seconds). - Doesn’t: network requests,
subprocess, threads, GUI toolkits like tkinter, and third-party packages such as numpy or pandas (the standard library only).
Need syntax help while you code? Keep the Python cheat sheet open in another tab; every snippet there opens straight in this compiler. For the one-liners that confuse most learners, see the list comprehension explainer and the f-string format builder.
Frequently asked questions
Is this a real Python interpreter?
Yes. It runs CPython 3 compiled to WebAssembly (the Pyodide project) inside a Web Worker in your browser. It is the same interpreter as desktop Python, not a simulation.
Does my code get sent to a server?
No. Code runs entirely on your device. The only time code leaves your browser is if you click an AI button (Explain or Fix), which sends that code to the AI model to answer.
Which modules can I import?
The whole Python standard library works: math, json, re, datetime, collections, itertools, functools, random, statistics, decimal, dataclasses and more. Third-party packages from PyPI (numpy, pandas, requests) are not installed, and network access, threads and subprocesses are not available in the browser sandbox.
How does input() work?
Type the lines your program will read into the stdin box under the editor before pressing Run. Each input() call reads the next line.
Why is the first run slower?
The Python runtime (about 12 MB) is downloaded and started on the first run. After that your browser caches it and runs start in milliseconds.
Can I save or share my code?
Your code is saved automatically in this browser (localStorage). The Share button puts your code into the page URL so anyone with the link sees the same snippet; nothing is stored on a server.