Pyodide
CPython compiled to WebAssembly, with NumPy, pandas and SciPy ported, running Python inside the browser or Node.js sandbox. The standard way to run Python in a browser or Node sandbox; ideal for short data bursts, unsuitable for anything needing an operating system.
Overview
Pyodide is "a port of CPython to WebAssembly/Emscripten", a "Python distribution for the browser and Node.js" licensed under the Mozilla Public License 2.0. Michael Droettboom created it at Mozilla in 2018 as part of the Iodide notebook project; it is now "an independent and community-driven open-source project" with its own governance document. It loads from a CDN script tag or the pyodide npm package (Node.js 18 or newer since 0.25.0), exposes a foreign function interface so JavaScript and Python can call each other with async/await, and installs packages with micropip: "Any pure Python package with a wheel available on PyPi is supported", and many packages with C, C++ and Rust extensions, including NumPy, pandas, SciPy, Matplotlib and scikit-learn, have been ported. Version 314.0.7, released on 14 September 2026, tracks Python 3.14.
The sandbox is the host's WebAssembly sandbox, which is why Pyodide is used as a zero-infrastructure Python interpreter. The constraints follow from that: threading and multiprocessing are "included but not working", sockets do not function, ssl is a stub, modules such as fcntl, pwd, resource, curses and tkinter are removed, and HTTP goes through the browser with "very little or no control over certificates, timeouts, proxies". Long computations block the main browser thread unless run in a Web Worker. There is no persistence beyond the in-memory filesystem and no snapshotting. For a Python sandbox that needs native packages, sockets or a filesystem that outlives the page, a server-side sandbox is required.
Notable
- Created at Mozilla in 2018; independent community project under MPL-2.0
- Version 314.0.7 released 14 September 2026, on Python 3.14
- Node.js below 18 unsupported since 0.25.0; tested browser minimums Firefox 112, Chrome 112, Safari 16.4
Pyodide specifications
| Attribute | Details |
|---|---|
| Isolation | CPython compiled to WebAssembly/Emscripten, confined by the browser or Node.js WebAssembly sandbox; no sockets, threads or subprocess; HTTP only via the host fetch stack |
| Deployment | Open-source project · Self-hostable |
| Open source | Yes (MPL-2.0) |
| SDKs and interfaces | JavaScript/TypeScript, Python |
| Cold start (vendor claim) | Not documented |
| Max session length | Not documented |
| Persistence | In-memory Emscripten filesystem for the life of the page or process; no snapshotting documented |
| GPU | No - CPU-only WebAssembly |
| Networking | HTTP via the browser fetch stack only (urllib3 and requests work within browser limits); the sockets module imports but does not function; ssl is a stub |
| Pricing | Free and open source |
| Free tier | Free to self-host |
| Compliance | Not documented |
| Regions | Not documented |
Facts from Pyodide’s public documentation, verified November 9, 2026. Performance numbers are vendor claims.
Strengths and trade-offs
Strengths
- You want Python with NumPy, pandas and SciPy running client-side with no server or container
- You need a Python interpreter embedded in a Node.js or browser-based agent without leaving the Wasm sandbox
- You want MPL-licensed, community-governed software with a long history
Trade-offs
- No threads, sockets, subprocess or TLS; networking is limited to what the browser fetch stack allows
- Only pure-Python wheels or packages the project has ported; arbitrary native dependencies will not install
- State lives in memory for the page or process; no snapshots
- Loading the distribution and packages costs download time on every fresh page
Good fit for: Running short Python and data-science snippets in a browser tab or Node.js process without a server-side sandbox.
How Pyodide compares
| Sandbox | Isolation | Open source | Self-host / BYOC | Cold start (vendor) | Max session | Snapshots / pause | GPU | SDKs |
|---|---|---|---|---|---|---|---|---|
| Pyodide | CPython in Wasm | Yes | Yes / No | Not documented | Not documented | No / No | No | JavaScript/TypeScript, Python |
| Wasmtime | Wasm sandbox | Yes | Yes / No | Not documented | Embedder-set | No / Not documented | No | CLI, Rust, C, C++, Python, .NET, Go, Ruby |
| Wasmer | Wasm sandbox | Yes | Yes / No | Not documented | Not documented | Not documented / Not documented | No | CLI, JavaScript/TypeScript, Python, Rust, Swift |
| WebContainers | Browser tab (WebAssembly) | No | No / No | ms (claimed) | Not documented | No / No | No | JavaScript/TypeScript |
| Codapi | Locked-down Docker container | Yes | Yes / No | 1-3 s per run (claim) | 5 s default | No / No | No | REST API, JavaScript/TypeScript |
| Val Town | Deno process sandbox | No | No / No | 100 ms deploy (claimed) | 1 min / 10 min (Pro) | No / Not documented | No | JavaScript/TypeScript, CLI, REST API, MCP server |
Frequently asked questions
What is Pyodide?
How does Pyodide isolate code?
Is Pyodide open source?
How much does Pyodide cost?
What are the alternatives to Pyodide?
Sources
Cite this page
Agent Sandboxes. (2026). Pyodide. agentsandboxes.org. Last reviewed November 9, 2026. https://agentsandboxes.org/sandboxes/pyodide/
Found an error or a missing sandbox? Submit a correction — every entry links to the sources it relies on.