runbun.dev
Bun Playground: Run Bun in your browser
Write TypeScript, install packages with bun install and serve apps with Bun.serve,
all in a browser tab. Built from Bun's own Rust crates compiled to WebAssembly: no install, no server, no
account.
What it is
runbun.dev is a Bun playground that runs entirely in your browser tab. Write TypeScript, install packages from
npm with bun install, run tests with bun test and serve an app with
Bun.serve, without installing Bun, creating an account or sending your code to a server. Projects
are saved in your browser, and a share link carries a whole project, so a bug reproduction is one URL.
const server = Bun.serve({
routes: {
"/": () => new Response(`Hello from Bun ${Bun.version}!`),
"/api/time": () =>
Response.json({ now: new Date(), bun: Bun.version }),
},
});
console.log(`Listening on ${server.url}`);
How it works
runbun.dev runs Bun client-side by compiling Bun's own Rust crates to 64-bit WebAssembly (wasm64): the
transpiler, module resolver, bundler, formatter and semver are Bun's code, not lookalikes. Your code runs in the
browser's JavaScript engine inside a Web Worker, where the Bun.*, bun:* and
node:* APIs are JavaScript shims over an in-memory virtual file system. A service worker serves
your modules and puts the responses of a Bun.serve or node:http server in the preview
pane. There is no remote container or VM: close the tab and nothing keeps running. The editor's completions,
hovers and type errors come from TypeScript 7's language service, also compiled to WebAssembly.
What works
Bun.servewith routes, WebSockets and streaming, previewed in the pagebun installfrom npm, withbun.lock;bun test;bun:sqliteBun.file,Bun.write,Bun.build(Bun's real bundler) andBun.password- Frameworks: Elysia, Hono, Vite and the Astro dev server, with hot reload
- TypeScript and JSX without a build step, and many
node:*built-ins (fs,path,http,events,crypto)
Examples
- Elysia, Hono, Vite and Astro + Solid dev servers
- Node built-ins and a
bun.lockinstall - Runnable examples:
Bun.serve, WebSockets,bun:sqlite,Bun.file,Bun.password, Elysia and Hono - Any public GitHub repo:
runbun.dev/?repo=owner/repo - Embed a runnable example in your own page, like the one above
What doesn't
It is not Bun itself. The runtime APIs are reimplemented in JavaScript, so coverage is uneven: a browser has no
processes and no raw sockets, so Bun.spawn, Bun.connect, Bun.sql,
bun:ffi and native .node addons are missing (Bun.$ runs Bun's builtins,
not other programs). The
compatibility pages list the status of every
Bun API and
Node built-in.
Browser support
Running code needs WebAssembly Memory64: Chrome and Edge 133+, and Firefox 134+. Safari, and every browser on iOS and iPadOS, open projects in edit-only mode until WebKit ships Memory64. Browser details.
Questions
Can I run Bun in the browser?
Yes. runbun.dev runs Bun projects in a browser tab. Bun's own transpiler, resolver, bundler, formatter and semver are compiled to WebAssembly, and the Bun.*, bun:* and node:* APIs are JavaScript shims. Most everyday code runs; processes, raw sockets and native addons don't. The compatibility pages list every API.
Is my code sent to a server?
No. Your code runs in your browser, and your projects are saved there. The browser only fetches packages from the npm registry when you install, and a GitHub repository when you open one. A short link stores a copy of a project on runbun.dev only when you choose to make one. See Privacy.
Which browsers does it work in?
Chrome and Edge 133+ and Firefox 134+ run code. Safari, and every browser on iOS and iPadOS, can open and edit projects but can't run them yet, because WebKit doesn't ship WebAssembly Memory64.
Which version of Bun is it?
Bun 1.4.4. Bun.version reports 1.4.4-browser, since the runtime APIs are reimplemented for the browser.
Does bun install work?
Yes. bun install fetches packages from npm into the project and caches them across projects, and installs the exact versions in an existing bun.lock. It doesn't write a bun.lock yet, and packages that need native .node addons can't load.
Is it free? Do I need an account?
It's free to use, and there is no account or sign-up.
Is runbun.dev an official Bun project?
No. runbun is an independent project, not affiliated with or endorsed by Oven or Bun.
Can I embed it in my own site?
Yes. Add the <bun-playground> element (from runbun.dev/embed.js or the @runbun/embed package) or an iframe, and your page gets a runnable Bun example. See Embedding.