· 6 min read
CSS Box Model Explained with Examples
CSS box model explained with examples: content, padding, border and margin, content-box vs border-box math, margin collapsing and DevTools tips.
WebFiddle is a free online compiler and code editor for HTML, CSS, JavaScript, TypeScript, PHP, Python, Node.js, SQL, Ruby and Lua. Pick a sandbox, write code and press Run. Your code executes on your own device, with nothing to install and no account to create.
10 languages
9 sandboxes in one place
Runs in your browser
Code is not executed on a server
No setup
Nothing to install
Free, no signup
No account required
Choose a language to open its compiler or editor. Every sandbox runs client-side and is free to use.
Write HTML, CSS and JavaScript side by side with a live preview in a sandboxed iframe, a console panel and quick-start templates.
OpenRun PHP 8.0 to 8.5 scripts in your browser with php-wasm 0.1.0 (WebAssembly). No local server or PHP install needed.
OpenPython 3.12 in your browser via Pyodide 0.26.1 (WebAssembly). Run scripts and try the standard library without installing anything.
OpenTry async/await, promises and console output in a Web Worker with a Node.js API shim. npm packages are not supported.
OpenCreate tables and run queries on SQLite in your browser with sql.js 1.14 (SQLite compiled to WebAssembly).
OpenWrite and run Ruby 3.4 in your browser with ruby.wasm 2.8.1 (WebAssembly). No Ruby install needed.
OpenRun Lua 5.3 scripts with Fengari (Lua 5.3 VM in JavaScript), handy for testing snippets before using them in a game or app.
OpenWrite TypeScript 5.8, see compiler diagnostics and run the transpiled JavaScript in the browser.
OpenBuild React 18 components in JSX or TSX with a live preview, ready-made sample projects and npm imports from esm.sh.
OpenNo sandbox needs a server to execute code. This is the engine behind each one.
| Sandbox | Version | Runs on |
|---|---|---|
| HTML, CSS & JavaScript | Your browser | sandboxed iframe with live preview |
| PHP | 8.0–8.5 | php-wasm 0.1.0 (WebAssembly) |
| Python | 3.12 | Pyodide 0.26.1 (WebAssembly) |
| Node.js | Your browser | Web Worker with a Node.js API shim (not a real Node.js process) |
| SQL | SQLite | sql.js 1.14 (SQLite compiled to WebAssembly) |
| Ruby | 3.4 | ruby.wasm 2.8.1 (WebAssembly) |
| Lua | 5.3 | Fengari (Lua 5.3 VM in JavaScript) |
| TypeScript | 5.8 | TypeScript compiler running in the browser |
| React | 18 | React UMD builds with in-browser Babel |
Open the editor for your language. Each sandbox loads only the engine it needs: WebAssembly builds for PHP, Python, SQLite and Ruby, and JavaScript for Lua, TypeScript, React and Node.js-style code.
Press Run and the code executes in your browser tab or a Web Worker. Output appears without a round-trip to a server, and nothing you type is sent to one for execution.
Share puts your code into the URL: most sandboxes compress it with LZ-string and the HTML editor uses Base64. Anyone with the link opens the same code, with no upload and no account.
Open a ready-made HTML, CSS and JavaScript example in the editor, then change it however you like.
Tutorials and write-ups on WebAssembly, JavaScript, React, Python, PHP and CSS.
· 6 min read
CSS box model explained with examples: content, padding, border and margin, content-box vs border-box math, margin collapsing and DevTools tips.
· 4 min read
Learn JavaScript basics: const and let, functions, the DOM, arrays and objects, with runnable examples and answers to common beginner questions.
· 4 min read
Learn CSS basics: selectors, padding and margin, Flexbox alignment, media queries, colors and units, with examples you can edit live.
WebFiddle is a free online compiler, code editor and code playground that runs entirely in your browser. It supports HTML, CSS, JavaScript, TypeScript, PHP, Python, Node.js, SQL, Ruby and Lua, plus a React playground. There is nothing to install and no account to create: open a sandbox, write your code and press Run to see the output.
There are 9 sandboxes: PHP 8.0 to 8.5 (php-wasm 0.1.0), Python 3.12 (Pyodide 0.26.1), SQL on SQLite (sql.js 1.14), Ruby 3.4 (ruby.wasm 2.8.1), Lua 5.3 (Fengari), TypeScript 5.8, React 18, a Node.js-style JavaScript runner, and an HTML, CSS and JavaScript editor with a live preview.
Most online compilers send your code to a remote server, which runs it and returns the output to your page. WebFiddle runs code on your own device instead: each sandbox loads an engine into the browser, using WebAssembly for PHP, Python, SQLite and Ruby, and Web Workers for Python and Node.js, so nothing is sent to a server for execution.
No. Your code runs inside your own browser: PHP, Python, SQLite and Ruby use WebAssembly builds, while Lua, TypeScript, React and the Node.js sandbox use JavaScript. Some engines are downloaded from public CDNs when a sandbox loads, but the code you write is never sent to a WebFiddle server to be executed.
Every sandbox is free to use, and none of them asks for an account, email address or sign-in. WebFiddle has no user accounts at all. Recent sessions from the HTML editor, PHP sandbox and React playground are saved in your browser's local storage, so they stay on this device and appear on the History page.
Use the Share button in any sandbox. WebFiddle stores your code in the link itself: most sandboxes compress it with LZ-string, and the HTML editor encodes it as Base64. Nothing is uploaded, so anyone who opens the link gets the same code, although very large programs produce very long URLs.
Yes. Every sandbox has an embeddable version at /embed/ followed by the language, such as /embed/python, which you can place in an iframe on a blog post or documentation page. Sandbox pages include a copy-ready embed snippet, and the embed shows the editor with a link to open the code in the full sandbox.
Everything runs in a browser tab, so programs cannot listen on network ports, load native extensions or read your real file system. The Node.js sandbox runs in a Web Worker with a Node.js API shim, not a real Node.js process, so npm packages cannot be loaded. SQL runs on SQLite only, not PostgreSQL or MySQL.