Preview HTML, CSS and JavaScript live in your browser: see the page as you type, test phone and tablet widths, read the console and download one file.
Sometimes you just want to see what a piece of HTML does: a snippet from a tutorial, an email template, a page a colleague sent. Paste it here and it renders beside the code, updating half a second after you stop typing, with no project to set up and nothing to install.
It opens on a small tide gauge page with a Log a reading button, so you can click it in the preview and watch “Reading logged: 1” appear in the console underneath.
Under the preview, the console collects console.log output, warnings, errors and failed promises, which saves opening the developer tools. alert() messages land there as well, rather than interrupting you with a dialog.
The page runs inside a locked sandbox, and that has side effects. It has no origin of its own, so localStorage, cookies and fetch calls to most APIs fail with a security error here even when they would work on your site. Forms cannot submit, pop-ups and dialogs are blocked, and code cannot navigate this page. For anything that depends on those, download the file and open it directly. The sandbox is also why it is safe to paste a page you did not write: it cannot read this site or anything saved in your browser.
Line numbers in console errors count from the top of the joined document, not from the JavaScript pane, so an error on line 3 of your script shows a higher number. The console keeps the latest 200 messages. A while (true) loop can freeze the tab because the preview cannot be stopped from outside it, so untick Update as I type before editing a loop you are unsure of. Your code is saved in this browser only and is not uploaded.
Console (0)
console.log output, alert() messages and errors from the page appear here.