Agent Sandboxesagentsandboxes.org
Sandbox profile · Open-source project

Pyodide

Answer in brief

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.

By the Agent Sandboxes editors · Updated

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

AttributeDetails
IsolationCPython 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
DeploymentOpen-source project · Self-hostable
Open sourceYes (MPL-2.0)
SDKs and interfacesJavaScript/TypeScript, Python
Cold start (vendor claim)Not documented
Max session lengthNot documented
PersistenceIn-memory Emscripten filesystem for the life of the page or process; no snapshotting documented
GPUNo - CPU-only WebAssembly
NetworkingHTTP 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
PricingFree and open source
Free tierFree to self-host
ComplianceNot documented
RegionsNot 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

SandboxIsolationOpen sourceSelf-host / BYOCCold start (vendor)Max sessionSnapshots / pauseGPUSDKs
PyodideCPython in WasmYesYes / NoNot documentedNot documentedNo / NoNoJavaScript/TypeScript, Python
WasmtimeWasm sandboxYesYes / NoNot documentedEmbedder-setNo / Not documentedNoCLI, Rust, C, C++, Python, .NET, Go, Ruby
WasmerWasm sandboxYesYes / NoNot documentedNot documentedNot documented / Not documentedNoCLI, JavaScript/TypeScript, Python, Rust, Swift
WebContainersBrowser tab (WebAssembly)NoNo / Noms (claimed)Not documentedNo / NoNoJavaScript/TypeScript
CodapiLocked-down Docker containerYesYes / No1-3 s per run (claim)5 s defaultNo / NoNoREST API, JavaScript/TypeScript
Val TownDeno process sandboxNoNo / No100 ms deploy (claimed)1 min / 10 min (Pro)No / Not documentedNoJavaScript/TypeScript, CLI, REST API, MCP server

See all Pyodide alternatives →

Frequently asked questions

What is 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.
How does Pyodide isolate code?
Pyodide documents its isolation as: 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.
Is Pyodide open source?
Yes (MPL-2.0). It can be self-hosted.
How much does Pyodide cost?
Free and open source Check the official pricing page for current rates.
What are the alternatives to Pyodide?
Common alternatives include Wasmtime, Wasmer, WebContainers, Codapi, Val Town. See Pyodide alternatives for a full comparison.

Sources

  1. pyodide.org/en/stable/
  2. pyodide.org/en/stable/usage/index.html
  3. pyodide.org/en/stable/usage/wasm-constraints.html
  4. pyodide.org/en/stable/project/about.html
  5. pyodide.org/en/stable/project/changelog.html
  6. github.com/pyodide/pyodide

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.