Online Python Compiler
Run Python 3 code online with the full standard library and stdin input. It runs in your browser with Pyodide (WebAssembly), so your code stays on your device.
Runs in your browser · Nothing uploaded · No sign-up
Something not working, or missing a feature? Send feedback
About the Python Compiler
The Python Compiler runs Python 3 in your browser with Pyodide, a WebAssembly build of CPython that includes the standard library. Programs can read standard input, and your code never leaves your device.
Your code runs in an isolated Web Worker in your browser, so it never leaves your device.
How to use the Python Compiler
- Write or paste Python code.
- Add input lines in the stdin box for input().
- Click Run. The first run downloads the Python runtime (about 10 MB); later runs start instantly.
Example
Input
name = input()
print(f"Hello, {name}!")
print(sum(range(1, 11)))Result
Hello, Ada! 55
With "Ada" in the stdin box. Each input() call reads the next stdin line.
Common mistakes
- input() with an empty stdin box. There is no interactive prompt. Put every value your program reads into the stdin box, one per line, before you click Run. With nothing left to read, input() returns an empty string (so int(input()) raises ValueError) and the next call raises EOFError.
- Third-party packages. import requests or import numpy fails because only the standard library is available. Use urllib, json, csv, statistics and the other built-in modules.
- Network and files. The program runs in a browser sandbox, so it cannot open sockets or read files on your computer. Paste the data into the code or stdin instead.
Works well with the Python Compiler
- JSON Formatter: pretty print JSON your program outputs.
- JavaScript Compiler: compare the same logic in JavaScript.
- Text & Code Diff: compare actual output with the expected output.
Frequently asked questions
Can I install packages with pip?
The standard library is available. Third-party packages from PyPI are not installed in this sandbox.
Why is the first run slower?
The Python runtime is downloaded once and then cached by your browser.
Which Python version is it?
Python 3, from the CPython build that Pyodide ships. Modern syntax such as f-strings, match statements and type hints works.
Is my code sent to a server?
No. Python runs in your browser with WebAssembly, so the code and its input stay on your device.
Is it a compiler or an interpreter?
An interpreter, like the python command on your computer: CPython compiles your code to bytecode and runs it immediately. "Python compiler" is simply what most people search for.
Can I run Python online without installing it?
Yes. Paste your code and press Run: Python 3.14 runs in your browser with WebAssembly, so there is nothing to install and no account to create. The first run downloads the runtime (about 10 MB), which your browser then caches.
How do I give input to a Python program online?
Type it into the stdin box before you click Run, one line per input() call. When the box runs out, the next input() returns an empty string and the one after raises EOFError. To read all of it at once, use sys.stdin.read().
Can I use NumPy or pandas?
Not in this compiler: only the standard library is available, so import numpy fails with ModuleNotFoundError. For NumPy, pandas or plotting, use a notebook service such as Google Colab or install Python locally.
How long can a Python program run?
Up to 5 seconds per run on the free plan and 15 seconds on Pro. A run that takes longer, such as an accidental infinite loop, is stopped.
Guides and tutorials
- Programming Languages
How to Run Python Code Online (No Install, With Input)
Run Python code online in your browser: a first program, input() and stdin, reading many lines, which modules work, and how to read a Python traceback.
· 5 min read
- Programming Languages
How to Run R Code Online (No RStudio, No Install)
Run R code online in your browser without RStudio: print values, explore built-in datasets, fit a linear model, read stdin, and fix the most common R errors.
· 5 min read
Related tools
JavaScript Compiler
Run JavaScript online in an isolated browser sandbox. See console output, errors and execution time instantly, with top-level await and stdin input.
TypeScript Compiler
Compile and run TypeScript online. Your code is type-checked with the official compiler in strict mode, then runs in a sandboxed worker in your browser.
PHP Compiler
Run PHP 8.4 code online and see the output instantly, with stdin input and mbstring. PHP runs in your browser with WebAssembly, so your code stays private.
C Compiler
Compile and run C code online with Clang 21, a GCC-compatible compiler: pick C89 (ANSI C), C99, C11, C17 or C23 and add stdin input. Your code stays private.
C++ Compiler
Run C++ code online for free: compile C++20 with Clang 21 and libc++, type stdin input and see the output. It runs in your browser, so your code stays private.
C# Compiler
Run C# code online with Roslyn and .NET 10: C# 14, top-level statements, LINQ, records and Console.ReadLine input, in your browser, so code stays private.