Online Python Compiler

Files
Packages · pip

Popular packages (numpy, pandas, matplotlib…) install themselves when you import them.

Popular packages
Terminal

Click Run (or press Ctrl+Enter) to see your program’s output.

  • Ctrl + Enter · run
  • Popular packages (numpy, pandas, matplotlib…) install themselves when you import them.
Loading Python…main.pyUTF-8
Shortcuts: Ctrl+Enter runPyodide · WebAssembly

Online Python compiler that runs in your browser

The editor above runs real Python 3.14 right in your browser. Type your code and press “Run” (or Ctrl+Enter) — nothing to install, no account, no waiting for a server.

What this tool is

A lightweight place to write and run Python programs: an editor with syntax highlighting, a terminal for output and a file panel. It is handy when you want to test a snippet, practise an exercise or show someone a working example.

Your files are saved in your browser's storage, so after a refresh you are back where you left off.

How it works

Under the hood it uses Pyodide — the CPython interpreter compiled to WebAssembly. Your browser downloads it once (the first visit can take a few seconds) and then runs your code locally, on your own computer or phone.

Your code is not sent to a server to be executed. That is why results appear instantly, and why programs cannot touch files on your disk — they only see files created in the “Files” panel.

What you can do

The interpreter covers most of what you need for lessons and small projects:

  • input() — the program pauses and waits for an answer typed into the terminal.
  • Packages without setup: import numpy, pandas, matplotlib, scipy or sympy and they install themselves on the first run. Anything else from PyPI that is pure Python can be added in the “Packages” panel (micropip).
  • Share your code with a link — the “Share” button copies a URL that opens your program in this editor for anyone you send it to.
  • Download the current file as a .py file and keep working on it in any other editor.
  • Several files in one project — create a helper module and import it from main.py, or read and write text files.
  • Charts and images — plt.show() from matplotlib draws the chart in the terminal, and saved PNG/JPG files can be opened in the editor.
  • The “Stop” button interrupts a program stuck in an infinite loop.

Limitations

Python in the browser runs in a sandbox, so not everything behaves as it does on a desktop install:

  • Threads and processes (threading, multiprocessing) do not work as they do on a computer — code runs on a single thread.
  • Network access is limited: there are no sockets, and HTTP requests are subject to browser security rules (CORS).
  • Packages with native code work only if they have been built for Pyodide (for example numpy, pandas, matplotlib). Libraries such as TensorFlow or tkinter are not available.
  • Very heavy computations will be slower than in regular Python installed on your machine.

Who it is for

Students who cannot install software on a school computer, and teachers who want the whole class to start coding at the same moment.

Anyone preparing for a computer science exam — practise algorithms, lists and processing text files with data, then move the same code to the environment used in the exam.

Beginners who want to find out whether they enjoy programming before setting up an editor and installing Python.

Examples to run

Click “Open in editor” to load an example into example.py, then run it and change it however you like.

Talking to your program: input()

The program asks for data, converts text to a number and replies.

from datetime import date

name = input("What is your name? ")
year = int(input("What year were you born? "))
age = date.today().year - year
print(f"Hi, {name}! This year you turn {age}.")

Lists and loops: average grade

Compute an average and print a tiny bar chart made of stars.

grades = [5, 4, 3, 5, 6, 4, 5]

average = sum(grades) / len(grades)
print(f"Average: {average:.2f}")

for grade in sorted(set(grades)):
    print(grade, "*" * grades.count(grade))

Functions: prime numbers

A function that checks whether a number is prime, and all primes below 50.

def is_prime(n):
    if n < 2:
        return False
    d = 2
    while d * d <= n:
        if n % d == 0:
            return False
        d += 1
    return True

print([n for n in range(50) if is_prime(n)])

Writing and reading a file

The program creates results.txt — after running it you will see the file in the “Files” panel.

with open("results.txt", "w") as f:
    for x in range(1, 6):
        f.write(f"{x} {x ** 2}\n")

with open("results.txt") as f:
    for line in f:
        x, square = line.split()
        print(f"{x}^2 = {square}")

A matplotlib chart

Just run it — matplotlib installs itself on the first import and the chart appears in the terminal.

import matplotlib.pyplot as plt

x = list(range(-5, 6))
y = [v ** 2 for v in x]

plt.plot(x, y, marker="o")
plt.title("y = x²")
plt.grid(True)
plt.show()

Frequently asked questions

Do I need to install Python on my computer?

No. The interpreter runs in your browser thanks to Pyodide and WebAssembly. A recent version of Chrome, Firefox, Edge or Safari is enough — on a phone too.

Do I need an account?

No. You can write and run code without logging in. Files are stored in your browser, so you will find them again when you come back on the same device.

Where does my code run?

On your device, inside the browser. Your code is not sent to a server to be executed, and programs have no access to files on your disk.

Which Python version is it?

Python 3.14 (Pyodide 314) with the standard library, so modules like math, random, datetime, collections and json all work.

How do I install a package such as numpy or pandas?

Usually you don't have to: popular packages such as numpy, pandas, matplotlib, scipy and sympy install themselves the first time you import them. For other packages open the “Packages” panel, type the name and confirm — installation uses micropip. Pure-Python packages work, as do packages built for Pyodide.

Can I share my code with someone?

Yes. Click “Share” and a link is copied to your clipboard. The code is stored in the link itself, so whoever opens it sees your program in the editor and can run it straight away.

Does input() work?

Yes. When your program calls input(), a field appears in the terminal. Type your answer and press Enter.

What can't I run here?

Programs that rely on threads, network sockets, tkinter windows or native packages that have not been built for Pyodide (such as TensorFlow). For those you need Python installed locally.