# HTML, CSS & JS Playground

> Free online HTML editor and viewer. Write HTML, CSS and JavaScript with a live preview and console, autosaved in your browser. No sign-up needed.

- URL: https://tools.crawlink.com/html-editor
- Category: Developer Tools
- Price: Free, no account, no usage limits
- Privacy: Runs entirely in your browser and works offline. Nothing you enter or upload leaves your device.

## What it does

A small CodePen-style playground that runs in your browser. Write HTML, CSS and JavaScript in three tabs and the preview on the right updates as you type, inside a sandboxed frame that cannot touch this site or your data. console.log output and JavaScript errors appear in the console panel, your work is autosaved on this device, and you can download everything as a single .html file.

## Features

- Separate HTML, CSS and JS editors with syntax highlighting
- Live preview in a sandboxed iframe
- Console panel for logs, warnings and errors
- Autosave in your browser, nothing uploaded
- Paste a full HTML document or just a fragment
- Download as a single .html file

## How to use

1. Write or paste markup in the HTML tab, styles in CSS and scripts in JS.
2. Watch the preview update automatically, or turn off Auto-run and press Run (Ctrl/Cmd + Enter).
3. Check console.log output and errors in the console under the preview.
4. Download the page as one .html file; your code is also saved in this browser automatically.

## FAQ

### Is my code saved?

Yes, on this device only. The playground stores your HTML, CSS and JavaScript in your browser's local storage a moment after you stop typing, so it is still there when you come back. Clearing site data or using a private window removes it, so download a copy of anything important.

### Is it safe to run JavaScript here?

The preview runs in an iframe with the sandbox attribute and only allow-scripts, so the code runs in an isolated, opaque origin: it cannot read this site's storage or cookies, open pop-ups or navigate the page. Still, only run code you trust.

### Can I use external libraries such as jQuery or Bootstrap?

Yes. Add a <script src="…"> or <link rel="stylesheet" href="…"> tag from a CDN in the HTML tab. Those files are fetched by the preview when you are online.

### Why does fetch or localStorage fail inside the preview?

Because the sandbox gives the preview an opaque origin, APIs tied to an origin such as localStorage, cookies and some requests are blocked or behave differently. Test those features on a real local server.

### How do I view an HTML file I already have?

Open the file in a text editor, copy everything and paste it into the HTML tab. A full document with <html>, <head> and <body> works; the CSS and JS tabs are added into it automatically.

Also searched as: html editor online, online html editor, html viewer, html preview, online code editor, html css js playground, live html editor, codepen alternative.

## Related tools

- [HTML Formatter](https://tools.crawlink.com/html-formatter): Beautify and tidy HTML markup
- [JavaScript Minifier & Beautifier](https://tools.crawlink.com/javascript-minifier): Minify JS with Terser (mangle, compress, source map) or beautify it
- [CSS Minifier & Beautifier](https://tools.crawlink.com/css-minifier): Minify CSS with CSSO or prettify it, with a bytes and gzip savings report
- [Markdown Editor](https://tools.crawlink.com/markdown-editor): Live preview and Markdown ⇄ HTML conversion
- [HTML to JSX Converter](https://tools.crawlink.com/html-to-jsx): Convert HTML or SVG to React JSX/TSX: className, style objects, self-closing tags
- [CSS Generator](https://tools.crawlink.com/css-generator): Gradients, shadows, radii and glassmorphism

---
Part of Tools by Crawlink — https://tools.crawlink.com/ · All tools: https://tools.crawlink.com/llms.txt
