JS
// app.js: runs in your browser. Output appears in the Console panel.
console.log('Hello from JavaScript!');
console.log('2 + 2 =', 2 + 2);
Free online JavaScript playground that runs in your browser: write JS against HTML and CSS, watch the DOM update in a live preview, read console output and share a link — no Node.js, no install.
Edit the JavaScript, HTML and CSS tabs.
Auto-run updates the browser preview as you type. Turn it off to run your changes manually.
Use the console for browser logs and errors, or evaluate a command against the preview.
Share creates a snapshot link. Download exports the source so you can continue locally.
// app.js: runs in your browser. Output appears in the Console panel.
console.log('Hello from JavaScript!');
console.log('2 + 2 =', 2 + 2);
<!-- index.html: the page app.js runs in. The #app element is there for your own code. -->
<main id="app">
<h1>JavaScript Playground</h1>
<p>Edit <code>app.js</code> and watch the <strong>Console</strong> panel. Anything you render into this page appears here.</p>
</main>
/* styles.css: a little styling for index.html. */
body {
margin: 0;
padding: 2rem 1.5rem;
font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
line-height: 1.6;
color: #1a1b1e;
}
h1 {
margin: 0 0 0.5rem;
font-size: 1.75rem;
}
p {
margin: 0;
color: #5c606b;
}
code {
padding: 0.1rem 0.3rem;
border-radius: 0.25rem;
background: #f4f5f8;
color: #1a1b1e;
}
The editor uses Monaco, the engine behind VS Code, with language-aware editing tools and familiar keyboard controls.
Edit the JavaScript, HTML and CSS tabs — the live preview updates automatically.
Switch the target from the language picker, then open the tabs you need.
Use the console for logs and errors, and Format to tidy the active tab.
Share the complete snippet or download it as a single HTML file.
JavaScript Playground
Live DOM Preview
Console Output
HTML & CSS Tabs
Instant Rerun
Shareable Links
Auto-run is on by default and updates the preview as you type. Turn it off in the editor settings to run manually with Run or Ctrl/⌘ + Enter.
The Console prompt can inspect browser globals and the rendered DOM, but not variables scoped inside ES modules or component state.
Console shortcuts apply when its prompt is focused. Editor shortcuts apply inside the code editor.
Code runs in a sandboxed browser preview, without Node.js, a backend, or private environment variables.
Download the project when you need build plugins, server APIs, native modules, or a production dependency workflow.
No. It runs in your browser against the DOM, so document, window, fetch and the console work, but Node modules, npm and stdin do not. For server-side JavaScript on Node.js use the JavaScript compiler at compilebytes.com/tools/javascript.