HTML, CSS and JavaScript Playground

Run HTML, CSS and real JavaScript in an isolated preview with a documented DOM subset.

On-device No sign-up Free to use

Run playground controls

?

Sanitized local elements only. Scripts, executable attributes, forms and resource URLs are removed. Up to 1,000 rendered nodes.

?

No resource URLs, escapes, imports or at-rules. Up to 256 KiB.

?

Real QuickJS ECMAScript with a DOM subset: #id/.class/tag selectors, textContent, value, attributes, create/append/remove, click/input handlers and console. No imports, network, cookies, storage, timers or host browser APIs. Total source up to 1 MiB.

Result

Showing an example.

Try local markup, styles and JavaScript with bounded execution.

The interactive preview shows a Counter heading, Add one button and 0. Clicking Add one changes the count to 1 without reloading the frame. Source JSON is downloadable.

Loading the tool. Your result will appear here.

https://usefreetools.net/html-css-js-playground · 20 November 2026

Was this helpful?

How to use HTML, CSS and JavaScript Playground

  1. Enter basic HTML, resource-free CSS and JavaScript using the documented DOM subset.
  2. Select Run playground, then use the rendered buttons and inputs in the isolated frame.
  3. Use Stop preview or Reset to discard the session; download source JSON to keep an editable copy.

Example: HTML, CSS and JavaScript Playground

Try local markup, styles and JavaScript with bounded execution.

You add
HTML: <h2>Counter</h2><button id="increment">Add one</button><p id="count">0</p> CSS: body { font-family: sans-serif; padding: 20px; } button { padding: 12px; } #count { font-size: 24px; } JavaScript: let count = 0; document.getElementById('increment').addEventListener('click', () => { count += 1; document.getElementById('count').textContent = String(count); console.log('Count', count); });
You get
The interactive preview shows a Counter heading, Add one button and 0. Clicking Add one changes the count to 1 without reloading the frame. Source JSON is downloadable.

Supported inputs and limits

  • Up to 1 MiB combined source, CSS under 256 KiB, and 1,000 created/rendered nodes.
  • HTML supports basic text, containers, buttons, labels and inputs.
  • Scripts, event attributes, forms and resource URLs are removed.
  • CSS resource URLs, escapes and at-rules are refused.
  • JavaScript runs in QuickJS with a 32 MiB heap, 1 MiB stack, 500 ms run/event interrupt and 2 second parent deadline.
More details

Supports simple #id/.class/tag selectors, textContent, value, attributes, create/append/remove, click/input and console.

No host browser objects, cookies, storage, timers, imports or network.

Console: 100 records of at most 2,000 characters;

100 events per session and at most four pending events.

The opaque frame runs only the fixed trusted renderer; user JS stays in the worker.

Stop/Reset discards the worker and frame.

This DOM subset differs from a full browser.

Where your input is processed

This tool does not upload your inputs. See the limits for anything saved on your device.

Questions about HTML, CSS and JavaScript Playground

Does JavaScript run in the site page?

It runs inside QuickJS in a dedicated worker. The opaque preview frame receives sanitized render data and runs only a fixed trusted renderer.

Which DOM interactions can I use?

Use simple id, class or tag selectors, textContent, value, supported attributes, create/append/remove, and click or input handlers. Full browser APIs are unavailable.

Can I stop an infinite JavaScript loop?

QuickJS interrupts execution after its run/event budget. A parent deadline can terminate the worker; Stop or Reset removes both worker and frame.

Page updated · Project managed by Tony Hines · Report a problem with HTML, CSS and JavaScript Playground