HTML Playground: Online HTML Editor with Live Preview
Saved snippets
Stored in this browser only.
Share
Creates a link that contains your code. Anyone with the link sees it in their playground.
The playground is a free online HTML editor for trying out whatever you want. Type code on one side and the preview on the other side updates as you go. You can also click into the preview and edit the text directly; the code changes to match. The DOM tree shows how the browser actually parsed your markup, so an unclosed tag or a nesting mistake stands out. The accessibility outline lists your headings, landmarks and labels as assistive technology sees them. Templates give you a head start with a full page, an article, a form or a table. Save your own snippets for later, and make a share link when you want to show someone your page. Your current code stays in this browser. When a page is done, paste it into the W3C Markup Validation Service (opens in a new tab) for a final check, or practise the same ideas step by step in the HTML course.

Frequently asked questions
How do I test HTML code online?
Type or paste it into the editor. The preview updates as you type, and there is nothing to install or save first. The DOM tree shows how the browser understood your markup, and the accessibility outline lets you check headings and labels. If you need exact phone or tablet sizes, HTML Preview (opens in a new tab) lets you set custom viewport widths.
What is the DOM tree?
It is the tree of elements the browser builds from your HTML. The DOM (Document Object Model) is defined in the WHATWG DOM Standard (opens in a new tab), and it does not always match what you typed: browsers add a missing <head> or <body> and close tags you forgot. Put the DOM tree next to your code and nesting mistakes show up fast. The tags and elements lesson covers nesting.
Can I share my code with someone?
Yes. Click Share and you get a link that contains your code. Whoever opens it sees your page in the playground and can edit their own copy. Nothing is uploaded to a server, and nobody needs an account. One catch: a very long page makes a very long link.
Does JavaScript run in the playground?
Only if you turn it on. The playground has a JavaScript toggle, and the script template switches it on for you. Open someone else's share link and JavaScript stays off until you enable it, so shared code never runs without your permission. Lesson previews never run scripts. For bigger HTML, CSS and JavaScript experiments with ready-made CSS generators, try html-css-js.com (opens in a new tab).