HTML Editor
Write HTML and view a live, responsive preview in your browser.
What is an online HTML editor?
An online HTML editor is a split view: the source code on one side, the rendered page on the other. You type markup, the browser reparses it, and the preview updates — no save, upload or build step in between.
It is the fastest way to check a fragment before it goes into a real project: whether a table nests correctly, whether a form is missing a label, or whether a layout survives a 390px viewport.
How to write and preview HTML
- Type or paste your markup into the HTML source pane.
- Leave Auto-run on to refresh the preview as you type, or switch it off and press Run when you want a clean render.
- Switch between desktop, tablet and mobile widths to see how the layout reflows.
- Read the HTML check panel: it lists parse errors with line numbers, and every element that never got a closing tag.
- Use Format to re-indent with js-beautify, then Copy or Download .html to take the file with you.
HTML editing examples
Unclosed element
<div> <p>Hello </div>
HTML check: <p> is never closed (line 2)
Missing doctype
<html><body>Hi</body></html>
HTML check: Missing <!DOCTYPE html> declaration
Duplicate attribute
<img src="a.png" src="b.png" alt="x">
HTML check: the same attribute appears twice on one element
Browser HTML editor vs local setup
| Dimension | This editor | Local dev server |
|---|---|---|
| Setup | Open the page and type | Install Node, a bundler and an editor |
| Feedback loop | Preview refreshes in about 400 ms | Depends on the dev server and hot reload |
| Validation | HTML5 parse errors and unclosed tags | Whatever linter the project configured |
| Privacy | Source stays in the browser tab | Source stays on your machine |
| Best for | Snippets, teaching, quick checks | Full projects with assets and routing |
HTML editor FAQ
Is the HTML I paste uploaded anywhere?
No. Parsing, formatting and rendering all happen in the browser tab. The preview iframe is built from a string, not from a request to a server.
Does JavaScript inside the preview run?
Yes, scripts run inside the preview frame. The frame is sandboxed with allow-scripts but without allow-same-origin, so the code cannot read this page or its storage.
Why does the checker not flag my unclosed <p> tag?
The HTML5 parser closes paragraphs, list items and table cells automatically, so that is not a parse error. The check panel instead lists elements that never received an explicit closing tag in your source.
Can I put CSS and JavaScript in the same editor?
Yes. Inline <style> and <script> blocks work in the preview. If you want a dedicated CSS pane with its own editor, use the CSS playground instead.
What does the Format button change?
Only whitespace and indentation, using js-beautify with two-space indents. Attributes, attribute order and content are left untouched.
Can I download what I wrote?
Yes. Download .html saves the current source as an index.html file you can open locally or drop into a project.