Skip to content
Toolzy 100% free · no login

Home › Developer Tools › Online Python Compiler

Online Python Compiler

Runs in your browserFree · no sign-up

Write Python 3 in the editor and press Run. Your program runs on your own device using Pyodide (CPython compiled to WebAssembly), so nothing is sent to a server.

Ctrl + Enter runs the code. Tab indents; press Esc then Tab to move focus out of the editor.

Other languages: JavaScript · SQL · Lua · HTML, CSS & JS playground

Advertisement

How to use this tool

  1. Type or paste your Python code in the editor, or pick an example.
  2. If your program uses input(), put the answers in the Input box, one line per call.
  3. Press Run (or Ctrl + Enter). The first run downloads Python once, about 12 MB, then it starts quickly.
  4. Read the output and errors below, then use Share link or Download to keep your code.

Real Python, running in your browser

This compiler does not send your code to a server. It uses Pyodide, a build of the official CPython interpreter compiled to WebAssembly, which is hosted on this site and loaded only on this page. That means you get the real Python 3 language and standard library: f-strings, list comprehensions, classes, generators, dataclasses, itertools, collections, json, re, math, datetime and much more. The first run downloads the interpreter (about 12 MB); after that your browser caches it and runs start almost instantly.

Input and output

Everything your program prints with print() appears in the output panel, and errors are shown with the normal Python traceback so you can find the line that failed. Online judges and textbooks often read input with input() or sys.stdin. Type the input lines in the Input box before you press Run; each call to input() takes the next line, and sys.stdin.read() gets everything at once. This is the same model used by competitive-programming sites, so you can paste a sample test case and check your answer.

Safety and limits

Your code runs in a Web Worker, separate from the page, so a long calculation does not freeze the editor. If a program loops forever, the Stop button or the time limit ends it by shutting the worker down. Because it runs in a browser, some things are not available: there is no access to your computer's files, no real terminal, no threads and no network sockets, and packages that need native code beyond those bundled with Pyodide cannot be installed. Speed is usually within a few times of desktop Python, which is plenty for learning, homework and interview practice.

Sharing and saving

Share link puts your code (and input) into the address itself, encoded after the # sign, and copies it. Anyone who opens that link sees the same code, but nothing is stored on a server. Your latest code is also kept in this browser's local storage so it is still there next time, and Download saves it as a .py file.

Frequently asked questions

Is this Python compiler free?

Yes. It is free with no sign-up, no limits on runs and no ads inside the editor.

Which Python version does it run?

Python 3 (CPython compiled to WebAssembly by Pyodide), including most of the standard library.

How do I give input to my program?

Type the input lines in the Input box before pressing Run. Each input() call reads the next line, and sys.stdin.read() reads all of it.

Can I install packages with pip?

Not from this page. It includes the Python standard library only, which covers most learning and practice tasks.

Is my code uploaded anywhere?

No. It runs on your device. A share link stores the code in the link itself, not on a server.

More free tools