Loading…
Format and validate HTML with indentation and error reporting. Use as default HTML tool; for minifying production HTML use html-minifier, for converting HTML to Markdown use html-to-markdown. Input: HTML ≤10MB. Returns formatted HTML or validation errors. 100% client-side.
HTML Formatter/Validator is loading — interactive editor will appear here. Use examples below to try instantly once loaded.
Press ? for keyboard shortcuts
Formats and minifies HTML with configurable indentation, self-closing tag style, quote style, and attribute sorting. Removes comments and empty attributes, formats embedded CSS and JavaScript within style/script tags, and detects tag mismatches to highlight unclosed or mis-nested elements.
HTML generated by templates or server-side rendering is often minified or poorly indented, making it difficult to debug or review. This formatter beautifies the markup while also catching structural issues like tag mismatches that cause rendering bugs.
This tool is part of the DevStackIO platform — a collection of free online developer tools from DevStackIO. Browse more free developer resources on DevStackIO.
Web developers debugging rendered HTML output, code reviewers auditing template-generated markup, and QA engineers checking for proper HTML structure.
Paste or type the HTML you want to format or minify in the input area
Set the indent size (2 or 4 spaces, or tabs) and choose self-closing tag style (trailing / or not)
Select quote style: single or double quotes for attribute values
Toggle options: sort attributes alphabetically, remove comments, remove empty attributes
Enable format embedded CSS/JS to also beautify content inside <style> and <script> tags
Click Format to see the output; tag mismatch warnings appear highlighted in the output area
Input: '<div><p>hello</p></div>' with 2-space indent. Output: formatted with each tag on its own line, properly indented by 2 spaces.Input: '<div><p>hello</div></p>' (mismatched). Output: formatted HTML plus a highlighted error pointing out the closing tag mismatch.Does the formatter fix invalid HTML?
No, it detects and reports tag mismatches but does not auto-correct them.
Can I format only a selection of the HTML?
The tool formats the entire document; use an editor plugin for partial formatting.
What happens to inline event handlers like onclick?
They are preserved and not modified by formatting.
Does it preserve conditional comments for IE?
Yes, conditional comments are preserved during formatting.
Authoritative specifications, standards, and in-depth reading for HTML Formatter/Validator.
Free online JSON formatter and validator with syntax highlighting and error line numbers. Use as default for beautify+validate+minify in one place; for two-file comparison use json-diff, for schema generation use json-schema-generator. Input: JSON ≤10MB. Returns formatted JSON or line-numbered error. 100% private.
Format or minify CSS with indentation control. Use as default CSS tool handling both directions; css-minifier URL is a noindex alias. Input: CSS ≤10MB. Returns formatted or minified CSS. 100% client-side.
Minify JS for production or beautify minified JS for debugging. Use for JS only; for JSON use json-formatter, for CSS use css-formatter. Input: JS text ≤10MB. Returns minified or beautified JS or syntax error. 100% client-side.
Free online SQL formatter with indentation and keyword casing. Format queries privately in browser.
Format and validate XML with indentation and well-formedness checks. Use for XML; for JSON use json-formatter, for XML to JSON conversion use xml-to-json. Input: XML ≤10MB. Returns formatted XML or line-numbered error. 100% client-side.
Format and validate YAML with syntax checks. Use for YAML editing; for JSON to YAML conversion use json-to-yaml, for TOML/YAML/JSON cross-conversion use toml-converter. Input: YAML ≤10MB. Returns formatted YAML or error. 100% client-side.
Analyze text for word count, readability, and language stats. Paste and get instant insights.
Compare two JSON documents and highlight added, removed, and changed keys with line-level diff. Use when comparing API responses or configs; for single-document formatting use json-formatter, for validation errors use json-validator. Input: two JSON texts ≤10MB. Returns highlighted diff. 100% client-side.