Skip to content

Python Online Compiler

Write and run Python 3 code directly in your browser — free, with no signup.

Tab inserts indentation. Press Escape, then Tab, to move focus out of the editor.

Output

Python loads when you start using the editor

Press Run to see the output of print() and any errors here.

How to use the Python online compiler

  1. Write or paste Python code in the editor. Tab indents by four spaces, and pressing Enter after a line ending in : indents the next line automatically.
  2. Press Run or Ctrl + Enter (⌘ + Enter on a Mac). Output from print() appears in the output panel.
  3. If your code fails, the error and traceback are shown in red. Use Go to line to jump to the line that caused it.
  4. Press Stop to end a program that takes too long. Your code is saved in your browser automatically, and you can download it as main.py.

How Python runs in your browser

Python is usually an interpreted language: the standard interpreter, CPython, translates your code to bytecode and runs it immediately, rather than producing a separate compiled program. This tool uses Pyodide, which is CPython itself compiled to WebAssembly, so real Python 3 runs directly in your browser — no server executes your code.

Python runs in a Web Worker, a background thread separate from the page. The editor stays responsive while your program runs, and a long-running program can be stopped at any time. The runtime is only downloaded once you start using the editor.

Reading user input

Programs that call input() read from the Input (stdin) box. Enter one value per line before running. For example, with the input Ada and 36 on two lines, this program:

Python
name = input("What is your name? ")
age = int(input("How old are you? "))
print(f"Hi {name}, in 10 years you will be {age + 10}.")

prints Hi Ada, in 10 years you will be 46.

What works and what doesn't

  • The full standard library is available, including math, json, re, datetime and collections.
  • Many scientific packages bundled with Pyodide, such as NumPy and pandas, load automatically when you import them.
  • Threads, subprocesses and raw network sockets are not available in the browser, so libraries that depend on them (for example requests) will not work.
  • Files your program writes exist only in memory and disappear after the run.

Other tools

Building for the web? The online HTML editor runs HTML, CSS and JavaScript with a live preview, and the HTML compiler runs JavaScript on demand with a console — much like this page does for Python. To check or tidy data your Python code produces, use the JSON editor.

Frequently asked questions

Is this Python compiler free?
Yes. It is completely free, with no account, signup or installation. Open the page, write code and press Run.
Is my Python code sent to a server?
No. Your code runs inside your own browser using Pyodide, a version of Python compiled to WebAssembly. The only downloads are the Python runtime itself and any packages your code imports, which come from the jsDelivr CDN.
Which Python version does it use?
Python 3.13, provided by Pyodide 0.29. The status next to the output shows the exact version once Python has loaded.
Why does the first run take a few seconds?
The first time you use the editor, your browser downloads the Python runtime (about 5–6 MB). Your browser caches it, so later visits start much faster. Python only starts loading when you begin using the editor, so the page itself stays fast.
How do I use input()?
Open Input (stdin) above the output and type the values your program needs, one line per input() call, before pressing Run. If the program asks for more input than you provided, input() raises an EOFError.
Can I use packages like NumPy or pandas?
Yes, for packages that are included with Pyodide, such as NumPy, pandas and SciPy. They are downloaded automatically when your code imports them. Packages that need native system libraries, threads or raw network sockets may not work.
How do I stop a program that runs forever?
Press Stop. Your code runs in a separate background thread (a Web Worker), so the page stays responsive even during an infinite loop, and Stop ends the program immediately.