HTML Editor

Write HTML and view a live, responsive preview in your browser.

SourceLines: 15 · Characters: 368
Templates
Preview
Validation:No syntax issues found.

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

  1. Type or paste your markup into the HTML source pane.
  2. Leave Auto-run on to refresh the preview as you type, or switch it off and press Run when you want a clean render.
  3. Switch between desktop, tablet and mobile widths to see how the layout reflows.
  4. Read the HTML check panel: it lists parse errors with line numbers, and every element that never got a closing tag.
  5. 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

DimensionThis editorLocal dev server
SetupOpen the page and typeInstall Node, a bundler and an editor
Feedback loopPreview refreshes in about 400 msDepends on the dev server and hot reload
ValidationHTML5 parse errors and unclosed tagsWhatever linter the project configured
PrivacySource stays in the browser tabSource stays on your machine
Best forSnippets, teaching, quick checksFull projects with assets and routing
FAQ

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.

All Tools