Skip to main content

Online Python Compiler

Python 3 · runs in your browser

Runs on your device · free

About this Python compiler

A free online Python compiler that runs on your own device

Mentr's online Python compiler runs real Python 3.14 inside your browser. Your code never goes to a server: Python is downloaded once, then every program runs on your phone or laptop. That makes it fast, private, and free for everyone.

It is built for students and beginners. input() works like a real terminal, errors point to the exact line in plain English, and the layout switches to tabs on a phone so you can practise anywhere.

real CPython, not a lookalike

Python 3.14.2

real CPython, not a lookalike

run your code; it stays on your device

0 servers

run your code; it stays on your device

one-time download, then cached

≈ 6.3 MB

one-time download, then cached

free, no sign-up, no install

₹0

free, no sign-up, no install

Features

Everything you need to practise Python

  • Real input()

    When your program asks a question, type the answer right in the output and press Enter, just like a terminal.

  • Errors in plain English

    Tracebacks are trimmed to your code, the line is highlighted, and common mistakes come with a hint.

  • Works on phones

    Code, Input and Output tabs, a thumb-reach Run button, and no zoom-in when you type on iPhone or Android.

  • numpy, pandas and more

    Import a package and it loads automatically. 357 packages are available, including numpy, pandas, scipy and sympy.

  • Autosave

    Your code is saved in this browser as you type. Come back later and it is still there.

  • Open and download .py files

    Load a .py file (up to 200 KB) from your computer, or download your program as main.py.

  • Safe by default

    A Stop button, a 15-second limit and an output cap mean an infinite loop can't freeze the page.

  • A friendly editor

    Syntax colours, Tab for 4 spaces, auto-indent after a colon, and Ctrl/⌘ + Enter to run.

How to use

How to run Python code online

  1. 1

    Write your code. Type Python in the main.py editor, or pick one of the ready examples from the Examples menu.

  2. 2

    Press Run. Click Run, or press Ctrl + Enter (⌘ + Enter on Mac). The first run downloads Python once; later runs start instantly.

  3. 3

    Answer input(). If your program calls input(), type your answer where the cursor blinks in the output and press Enter.

  4. 4

    Fix errors. If something breaks, read the hint and click the line number to jump straight to the mistake.

  5. 5

    Save your work. Your code autosaves in the browser. Use Download to keep a copy as main.py.

Phone & tablet

A Python compiler for mobile that actually fits the screen

Most online compilers squeeze a desktop layout onto a phone. Here the same compiler switches to three tabs: Code, Input and Output. Pressing Run jumps to the output, and tapping an error line takes you back to the code.

It runs in Chrome on Android and Safari on iPhone and iPad, with nothing to install. Text is 16 px on phones so the browser doesn't zoom in when you type.

input()

An online Python compiler with input() that feels like a terminal

Many browser compilers make you type every answer into a box before you press Run. On modern browsers this compiler pauses your program at input() and waits for you to type, so quizzes, games and calculators work the way they do on a laptop.

On older browsers that can't pause, an Input box appears instead: write one answer per line, in order, and they are fed to input() as your program runs.

Good to know

Is it a Python compiler or an interpreter?

Both, in a way. CPython first compiles your code into bytecode, then its interpreter runs that bytecode. "Online Python compiler" is simply the name most people search for. What runs here is the standard CPython 3.14 interpreter, compiled to WebAssembly so the browser can run it.

Examples

Python examples to run right now

These are in the Examples menu at the top of the compiler. Pick one and press Run.

Reading input()
name = input("What is your name? ")
age = int(input("How old are you? "))
print(f"Hi {name}! Next year you will be {age + 1}.")
Times table loop
n = 7
for i in range(1, 11):
    print(f"{n} x {i:>2} = {n * i}")
Lists and functions
def average(numbers):
    return sum(numbers) / len(numbers)

scores = [78, 92, 85, 64, 99]
print("Scores:", scores)
print("Highest:", max(scores))
print("Average:", round(average(scores), 1))

Engineering

How this Python compiler runs in your browser

Pyodide 314.0.7 (CPython compiled to WebAssembly), a background Web Worker, and a shared-memory trick that lets input() pause. We wrote up the whole architecture, step by step, with diagrams and the real numbers.

Read how we built it

Honest limits

What it can't do (yet)

  • Windows and graphics libraries such as tkinter and turtle don't work in a browser.
  • matplotlib imports, but plots are not displayed yet.
  • Only packages built for Pyodide can be imported; pip install isn't available.
  • Each run stops after 15 seconds.
  • Code is saved in this browser only, so it won't follow you to another device.

New to Python? Learn it free, then practise here

Mentr's free Python course has short lessons, runnable examples, practice questions, five projects and a certificate.

Start the free Python course

FAQ

Online Python compiler: frequently asked questions

+Is this online Python compiler free?

Yes. It is completely free, with no sign-up and nothing to install. Because your code runs on your own device, there is no server cost per run.

+Which Python version does it use?

Python 3.14.2. It is the real CPython interpreter, compiled to WebAssembly by the Pyodide project (version 314.0.7), so the language and standard library behave like Python on a laptop.

+Does it support input()?

Yes. On modern browsers your program pauses at input() and you type the answer straight into the output, then press Enter. On older browsers an Input box appears where you write one answer per line before running.

+Is my code sent to a server?

No. The page downloads the Python runtime once and your program runs entirely inside your browser. Your code is saved only in this browser's local storage. Packages such as numpy are downloaded from a CDN the first time you import them; the download doesn't include your code.

+Can I use it on my phone?

Yes. It works in Chrome on Android and Safari on iPhone and iPad. On small screens it switches to Code, Input and Output tabs with a Run button near your thumb. The first visit downloads about 6.3 MB; after that it loads from cache.

+Can I use numpy, pandas or other libraries?

Yes, for packages built for Pyodide. 357 are available, including numpy, pandas, scipy and sympy, and they load automatically when you import them. pip install, tkinter and turtle are not available, and matplotlib plots are not displayed yet.

+Why did my program stop after 15 seconds?

Each run has a 15-second limit so an accidental infinite loop can't freeze your browser. Time spent waiting for you to type an input() answer doesn't count. You can also press Stop at any time.

+Will my code be saved?

Yes, in this browser. It autosaves as you type and is still there when you come back. To keep a copy or move it to another device, use Download to save main.py.

+How does a Python compiler run inside a browser?

Python itself is compiled to WebAssembly, a fast format every modern browser can run. Your program runs in a background Web Worker so the page stays smooth. We explain the full architecture, step by step, in our engineering write-up.

Guides

More on Python compilers