How is this HTML editor different from an XML viewer?
An XML viewer renders a parsed tree as a collapsible outline so you can navigate the structure — it is read-only by design. This HTML editor is a writable two-pane workspace: you type or paste HTML on the left, the formatted output appears on the right, and you reformat any time with the Run button. The XML viewer answers "what is in this document"; the HTML editor answers "let me change this document".
Does the editor offer real-time validation?
It does syntax-shape validation at format time — unbalanced tags surface as a misindented output and the formatter sets indent level back to zero on a stray closing tag. For full HTML5 conformance checking with attribute and content-model rules, run the output through the W3C Nu Html Checker or our html-validator tool. The editor focuses on responsiveness; validators focus on completeness.
Will the editor auto-close tags as I type?
No. This is a deliberately minimal textarea-based editor — what you type is what you get. Auto-close, snippets, and Emmet are intentionally omitted because they hide character-level changes and confuse beginners learning HTML. For auto-close, use VS Code or the Codespaces editor; for paste-and-tidy, this is faster.
Can I switch indentation between 2 spaces, 4 spaces, and tabs?
Yes. The toolbar dropdown picks 2 spaces (Google / Airbnb default), 4 spaces (PEP-style), or a tab character. Switching the dropdown then clicking Run reformats the output to the new convention. The convention is applied uniformly so the resulting file matches your project Prettier or .editorconfig settings.
How does the editor handle void elements like <br> and <img>?
Void elements never get a child indent. The formatter detects br, hr, img, input, link, meta, area, base, col, embed, param, source, track, and wbr — emits them on a single line, and does not increase the indent level afterwards. This matches HTML5 parsing rules and prevents the cascading-indent bug that plagues naive formatters.
Is the HTML I paste sent to your servers?
No. Editing and formatting run entirely in your browser. Pages containing API keys in script tags, customer data in inline JSON, or proprietary CSS classes never leave your device. Open DevTools → Network and click Run to confirm no requests are made.
How is the editor different from html-formatter and html-viewer?
html-viewer is read-only — it parses and displays. html-formatter is one-shot — paste, click, copy. html-editor is the workspace: you can edit, reformat, edit again, reformat again, all in one tab. Use the editor when you are iterating on HTML; use the formatter for a single quick reformat.
Does the editor preserve HTML comments?
Yes. The tokeniser recognises <!-- … --> as a single token and emits it intact at the current indent level. Comments survive arbitrarily many format passes — they are never stripped, reordered, or split across lines.