Online Python Compiler
Write and run Python 3 in your browser. Free, no install, no sign-up. pandas, NumPy, Matplotlib and scikit-learn are ready to import.
Click Run to see output
Or press Ctrl + Enter
The full editor adds sessions that save automatically, input(), your own files (CSV, Excel, JSON, SQLite), sharing links and .py export.
Python examples
All examplesEach example has code you can run and edit on the page, plus an explanation of how it works.
Algorithms
- Binary Search in Python
- Bubble Sort in Python
- Fibonacci Sequence in Python
- Insertion Sort in Python
- Selection Sort in Python
- Two Sum Algorithm in Python
- Breadth-First Search (BFS) in Python
- Depth-First Search (DFS) in Python
- Maze Generator and Solver in Python
- Merge Sort in Python
- Quick Sort in Python
- Dijkstra's Algorithm in Python
Data Structures
Data Science
Data Visualization
Machine Learning
Compilers for data science libraries
About this compiler
How this online Python compiler works
PythonHere runs Python 3.13 right in your browser. It's the real CPython interpreter, compiled to WebAssembly by the Pyodide project, so your code behaves the way it would on your own machine. The first visit has to download Python, which takes a moment. After that your browser keeps a copy, and the editor is ready in a few seconds.
Your code runs on your computer, not on ours. Sessions are saved in your browser, and nothing you write is sent to us unless you click Share to make a link.
What you can do
- Import pandas, NumPy, Matplotlib, scikit-learn, SciPy, SymPy and more; they load on first import.
- Install pure-Python packages from PyPI just by importing them.
- See Matplotlib charts right in the output panel.
- Read and write your own files by name:
pd.read_csv("data.csv"). - Keep several sessions; each one saves as you type.
Limitations
- Packages that need native code not built for WebAssembly (PyTorch, TensorFlow) can't be installed.
- No raw network sockets; most web requests from Python are blocked by the browser.
- Heavy computations run slower than on a native Python install.
input()needs the full editor, and isn't supported in Safari yet.
Keyboard shortcuts
| Ctrl + Enter | Run code (Stop while it runs) |
| Ctrl + K | Command palette |
| Ctrl + Z / Ctrl + Shift + Z | Undo / redo |
| Ctrl + Space | Show suggestions |
On a Mac, use ⌘ instead of Ctrl.