Back to Editor

About OnlinePy

Why We Built OnlinePy

We believe coding should be accessible, private, and free from annoying ads. Too many online Python compilers require you to create an account, bombard you with advertisements, or send your code to remote servers. We built OnlinePy to be different — a tool that respects your privacy and lets you focus on what matters: writing code.

Our mission is simple: provide the fastest, most private way to run Python online, with zero barriers to entry.

The Technology: Pyodide + WebAssembly

OnlinePy is powered by Pyodide, an ambitious project that compiles the entire CPython interpreter and scientific Python stack to WebAssembly (WASM). This means your Python code executes natively inside your browser — no backend server, no cloud container, no network round-trip.

How It Works

  • 1.Pyodide compiles CPython (the reference Python interpreter) to WebAssembly bytecode
  • 2.Your browser downloads and runs this WASM module locally
  • 3.Python code executes in a sandboxed environment within your browser
  • 4.Results are displayed instantly — no network round-trip needed

We use Pyodide v0.29.3, leveraging the full power of SharedArrayBufferfor better multi-threading performance and OPFS (Origin Private File System) for efficient caching of Python packages. Once loaded, the environment is cached — allowing you to even run Python offline.

70-90%
Native speed performance
~4GB
Maximum WASM heap size

Quick Guide: Using NumPy in OnlinePy

Getting started with scientific Python is straightforward. Simply import the library — OnlinePy will automatically install it at runtime when needed.

python
import numpy as np

# Create an array
arr = np.array([1, 2, 3, 4, 5])

# Basic operations
print(f"Mean: {np.mean(arr)}")
print(f"Std: {np.std(arr)}")
print(f"Sum: {np.sum(arr)}")

# Matrix operations
matrix = np.array([[1, 2], [3, 4]])
print(f"\nDeterminant: {np.linalg.det(matrix)}")

💡 Tip: The first run may take a few seconds as NumPy loads into memory. Subsequent runs are instant.

Getting Started Tutorial

1. Write Your Code

Open the editor and start typing Python code. The editor supports syntax highlighting, auto-indentation, and line numbers — just like a desktop IDE.

2. Run with One Click

Click the Run button (or press Ctrl+Enter) to execute your code. Output appears instantly in the terminal panel below.

3. Handle Input

When your code calls input(), a prompt appears in the terminal. Type your input and press Enter to continue execution.

4. Use Scientific Libraries

Import libraries like NumPy, Pandas, or Matplotlib directly — OnlinePy will automatically install them at runtime when you import them.

python
import pandas as pd

df = pd.DataFrame({
    'name': ['Alice', 'Bob', 'Charlie'],
    'score': [95, 87, 92]
})
print(df.describe())

5. Visualize with Matplotlib

Charts and plots render inline. Just call plt.show() to display your visualization.

python
import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(0, 2 * np.pi, 100)
plt.plot(x, np.sin(x))
plt.title("Sine Wave")
plt.show()

FAQ

What Python version does OnlinePy use?
OnlinePy runs CPython 3.13.2 via Pyodide. This matches the latest stable Python release.
Can I install additional packages?
Yes! OnlinePy automatically installs packages at runtime when you import them. Packages included in the Pyodide distribution (NumPy, Pandas, Matplotlib, SciPy, scikit-learn, and many more) are loaded automatically. Most pure Python packages on PyPI can also be installed at runtime. Only packages with C extensions that are not pre-built for WebAssembly may not be available.
Does OnlinePy work on mobile devices?
Yes, OnlinePy works on modern mobile browsers. However, for the best experience, we recommend using a desktop or laptop with a keyboard.
Why is the first run slower?
The first run downloads the Pyodide WebAssembly runtime (~10MB). Once cached by your browser, subsequent visits load almost instantly. You can even use OnlinePy offline after the initial load.
Can I share my code with others?
Yes. You can share your code by copying the URL — OnlinePy encodes your code into the URL, so anyone with the link can see and run the exact same code.
What happens to my code when I close the browser?
Your code is stored locally in your browser's storage. When you return, your previous code will still be there. Nothing is ever sent to our servers.

Ready to Start Coding?

Experience the fastest way to run Python online. No setup, no ads, just code.

Go to Online Python Editor