Skip to main content
Mentr by PaprlybyPaprly
Student Guides

How to Run Python Code Online (Free, No Install)

Run Python in your browser in under a minute: write code, press Run, answer input(), read errors and save your file. A free, no-install guide for beginners.

Mentr Engineering6 min read

You don't need to install anything to start writing Python. A browser-based compiler gives you an editor, a Run button and an output window in one tab, on a laptop, a school computer or a phone. This guide walks through running your first program, using input(), reading errors and saving your work, using Mentr's free online Python compiler as the example.

Step 1: Open a compiler and write one line

Open mentr.in/openpythoncompiler. The left side (or the Code tab on a phone) is main.py, your program. Type a single line:

print("Hello, world!")

The first time you open the page, your browser downloads Python itself, about 6.3 MB. A progress bar shows while it loads. After that it comes from your browser's cache and starts almost instantly.

Step 2: Press Run

Click Run, or press Ctrl + Enter (⌘ + Enter on a Mac). Output appears on the right as your program prints it. On a phone, the compiler switches to the Output tab for you.

Step 3: Ask the user something with input()

Try a program that asks a question:

name = input("What is your name? ")
print("Hi", name)

When you press Run, the prompt appears in the output with a blinking cursor right after it. Type your answer and press Enter, and the program carries on. On older browsers an Input box appears instead: write one answer per line before you press Run.

Step 4: Read the error, then jump to the line

Mistakes are normal. If you forget a colon or misspell a name, the output shows the error type, the line number and, for common mistakes, a plain-English hint. Click “Line N in main.py” to jump to the problem. The full traceback is one click away if you want it.

Errors beginners see most
ErrorWhat it usually means
SyntaxErrorA typo in the shape of the code: a missing colon, bracket or quote
IndentationErrorThe spaces at the start of a line don't line up with the block
NameErrorA variable or function name is misspelled or used before it is set
TypeErrorMixing types, such as adding a number to text
ValueErrorRight type, wrong value, such as int("abc")

Step 5: Save your work

  • Your code autosaves in this browser as you type, so it is still there tomorrow.
  • Press Download to keep a copy as main.py.
  • Press Open (the upload icon) to load a .py file up to 200 KB.
  • Use the Examples menu for ready programs: loops, if/elif, lists, a dice game and a star pattern.

When to install Python instead

An online compiler is ideal for learning, homework and quick experiments. Install Python on a laptop when you need files on disk, windows and graphics (tkinter, turtle), long-running programs, or any package from pip. Browser compilers only load packages that have been built for WebAssembly.

Common questions

Can I run Python online without downloading anything?
You don't install anything. The browser downloads the Python runtime once (about 6.3 MB) and caches it, then runs your code in the page.
Is it free to run Python online on Mentr?
Yes. The compiler is free with no sign-up. Because your code runs on your own device, there is no per-run server cost.
Which Python version runs?
Python 3.14.2, the real CPython interpreter compiled to WebAssembly by the Pyodide project.
Why did my program stop after 15 seconds?
Each run has a 15-second limit so an infinite loop can't freeze the page. Time spent waiting for your input() answer doesn't count.