Python code runner: paste it, run it, see the output
This is a free online Python code runner. Paste any Python code into the editor above and press Run (or Ctrl+Enter, Cmd+Enter on a Mac). Your program runs straight away and its output appears beside the code. There is nothing to install and no account to make.
It is handy for checking a snippet from a tutorial or Stack Overflow, testing an idea before you put it in a bigger project, doing homework on a computer where you cannot install Python, or running code on your phone.
How to run Python code online
- Paste or type your code into the editor at the top of this page.
- Press Run. On a phone, the Output tab opens by itself.
- Read the output. If your code calls
input(), type your answer in the output panel and press Enter. - Need a library? Type its name in the
pip installbox and press Install, then run again.
What this runner can do
- Real Python 3.12
Not a simulation: the standard CPython interpreter (via Pyodide), so code behaves as it does on your computer.
- input() works
When your program asks a question, type the answer in the output panel and it carries on, like a terminal.
- pip packages
Type a package name such as numpy or pandas in the pip install box and press Install.
- Several files
Add helper modules and import them, or read and write text files; files your code creates appear in the file list.
- Clear errors
Tracebacks show the line number and the error type, so you can see what broke and where.
- Share, download, visualize
Copy a link to your code, download it as a .py file (or all files as a .zip), or step through it line by line in the visualizer.
Try it with these snippets
Each one opens in the runner above, ready to run. The output shown is what it prints.
Hello, world with a variable
Run this codename = "PythonExecutor"
print(f"Hello from {name}!")
print("2 + 3 =", 2 + 3)Output
Hello from PythonExecutor! 2 + 3 = 5
Sort a dictionary by value
Run this codescores = {"Asha": 91, "Bikash": 78, "Chen": 85}
for name, score in sorted(scores.items(), key=lambda item: item[1], reverse=True):
print(f"{name:<8}{score}")
print("Average:", sum(scores.values()) / len(scores))Output
Asha 91 Chen 85 Bikash 78 Average: 84.66666666666667
First ten Fibonacci numbers
Run this codedef fib(n):
a, b = 0, 1
for _ in range(n):
a, b = b, a + b
return a
print([fib(i) for i in range(10)])Output
[0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
Code runner, compiler or IDE?
People search for an “online Python compiler” or “Python interpreter” when they mean the same thing as a code runner: somewhere to run Python and see the result. Python is interpreted, so what runs your code here is the Python interpreter itself. A full IDE such as VS Code or PyCharm adds project tools, debugging and version control, which you need for large projects but not to try out code. For a bigger workspace with several files, use the Python playground; to watch each line run, use the Python visualizer.
Frequently asked questions
What is a Python code runner?
A Python code runner is a tool that runs Python code and shows you what it prints, without you installing Python. You paste or type code, press Run, and the output and any error messages appear next to it.
Is this Python code runner free?
Yes. It is free, with no sign-up and no limit on how often you run code.
Which version of Python does it run?
Python 3.12, using Pyodide, the official CPython interpreter compiled for the web. Most of the standard library is available, including math, random, datetime, json, re, collections and itertools.
Can I run code that uses input()?
Yes. When your program calls input(), it pauses and waits for you to type an answer in the output panel, then continues. This also works on phones.
Can I install packages like numpy or pandas?
Yes. Type the package names in the pip install box above the editor and press Install. Pure-Python packages and the scientific packages that Pyodide provides, such as numpy and pandas, can be installed.
Where does my code run?
In your own browser, on your own device. Nothing is executed on a server, so there is no queue, and your files are saved in this browser for next time.
How do I stop a program that runs forever?
Reload the page. Your code is saved in the browser, so it will still be there.
Does it work on a phone or tablet?
Yes. On phones the editor and output have their own tabs: write your code under Input, press Run, and the Output tab opens with the result.