HTML Tools
Format, minify, validate, and diff HTML in your browser.
Tools
HTML Formatter
Format HTML into clean, readable markup.
HTML Minifier
Remove unnecessary formatting whitespace.
HTML Validator
Check HTML for structural and accessibility issues.
HTML Entity Encoder & Decoder
Encode text to HTML character references or decode them safely.
HTML Diff
Compare two HTML documents structurally.
Formatter vs. Minifier vs. Validator vs. Diff
HTML Validator only reports whether the markup is structurally well-formed and where it breaks, nothing is rewritten. HTML Formatter re-indents markup for reading or review without changing what it renders. HTML Minifier strips whitespace and comments to reduce file size for production. HTML Diff compares two documents' markup line by line, not their rendered output, so it's the right tool for reviewing a template change, not for confirming two pages look the same in a browser.
Void elements and boolean attributes
Elements like <br>, <img>, <input>, and <hr> are void: they can never have content or a closing tag, so the Formatter won't add one and the Validator won't flag a missing one. Boolean attributes like disabled, checked, and required don't take a value; writing disabled="disabled" works but is unnecessary, and disabled alone is the standard form.
What the Validator doesn't check
A well-formed document can still be a bad one. The Validator catches parse-level problems: unclosed tags, invalid nesting (like a <div> inside a <p>), and similar structural errors. It doesn't check accessibility (missing alt text, heading order, ARIA attributes), SEO metadata, or whether a tag or attribute is deprecated. Passing here means the markup parses cleanly, not that it's correct for users or search engines.
Reading an HTML Diff result
Because Diff compares markup text, changes that don't affect rendering still show up: attributes in a different order, single vs. double quotes around an attribute value, or extra whitespace between tags. None of these change how a browser displays the page, so a large-looking diff on a small visual change usually means formatting drifted, not that the content actually changed. Running both versions through the Formatter first, with the same settings, removes most of that noise before comparing.
Frequently asked questions
- Which HTML tool should I use?
- Validator to check structure without changing anything, Formatter to re-indent markup for reading or review, Minifier to shrink markup for production, Diff to see what changed between two versions. Formatting and minifying both surface parse errors as a side effect, since malformed markup can't be safely rewritten.
- Does the Validator check accessibility or SEO?
- No. It checks structural well-formedness: unclosed tags, improper nesting, and similar parse-level issues. It doesn't check alt text, heading order, ARIA usage, meta tags, or anything a linter or accessibility auditor would flag.
- Why does HTML Diff show a change when the page looks identical?
- Diff compares markup, not rendered output. Reordered attributes, a different quote style, or whitespace between tags all count as a change even though a browser renders them the same way. If you only care about rendered behavior, a markup diff isn't the right signal by itself.
- Do I need to close tags like <br> or <img>?
- No. Void elements have no content and no closing tag; writing <br></br> is not standard HTML. A self-closing-looking <br /> is accepted for XHTML-style habit but the trailing slash is optional and ignored.
- Why does the Formatter leave some whitespace untouched?
- Content inside <pre>, <textarea>, <script>, and <style> is preserved exactly, including its whitespace, because reformatting it would change what the page actually does or displays, not just how the source looks.