JSON Formatter
JSON Formatter for developers — instant, offline-style and privacy-safe.
Beautify minified or messy HTML — each tag on its own line, indented by nesting level — right in your browser. A quick regex tidier, not a full parser.
Your browser is preparing the tool. It runs 100% locally.
Paste minified or untidy HTML and the tool reformats it so each tag sits on its own line, indented two spaces per nesting level, making the structure easy to read. It is a lightweight regex-based tidier — it does not parse the HTML into a DOM — so it is great for a quick read of compact markup but can misindent void elements such as br and img. Everything runs in your browser; nothing is uploaded.
This tool takes HTML that has been collapsed onto one line, or indented inconsistently, and lays it out with one tag per line and a clean two-space indent for each level of nesting. The result is markup you can actually read and follow.
It is the quick way to make sense of a minified template, a copied snippet, or the output of a tool that produced a wall of tags — without opening an editor or installing anything.
The tool uses a regular expression to insert a line break wherever one tag ends and the next begins, so every tag lands on its own line. It then walks those lines keeping a running nesting depth: an opening tag increases the depth, a closing tag decreases it, and each line is indented by two spaces per level.
This is pattern-based, not a true parse. The tool never builds a document tree or checks that the HTML is valid — it simply reacts to the shape of the tags. That makes it fast and dependency-free, and it handles ordinary nested markup well, but it can be fooled by the edge cases a real parser would handle.
1 · break the markup so each tag is on its own line
2 · opening tag → indent deeper · closing tag → step back out
3 · two spaces of indent per nesting level
note: it reacts to tag shape — it does not parse a DOMBefore: <ul><li>One</li><li>Two</li></ul>
After:
<ul> <li>One</li> <li>Two</li>
</ul>Each level adds two spaces. Void elements such as br and img have no closing tag, so when one sits on its own line the depth counter treats it as an opener and over-indents everything after it — a known limitation of the regex approach.
Your HTML never leaves your device. It is reformatted in your browser with no network request, so nothing is uploaded to any server.
Because the work is local, you can safely tidy proprietary templates, internal markup or client code without it being stored or sent anywhere.
Nothing persists between sessions — close the tab and the input and output are gone.
It handles ordinary nested HTML cleanly, but it is a regex tidier, not a parser. It never checks that the markup is valid or that tags are balanced — it just reflows what you give it, so malformed input produces malformed output.
Void elements are the main pitfall. Because br, img, input and similar tags have no closing tag, the depth counter treats one sitting on its own line as an opener and indents the following lines too deeply. Cleaning those up by hand may be needed.
Attributes that contain a closing angle-bracket character — for example inside a quoted value — can confuse the tag-splitting regex, since it keys off that character rather than understanding quotes. A real parser tracks quoting; this tool does not.
It is not guaranteed idempotent. Running it on already-formatted HTML, or on markup with significant whitespace (such as inside a pre or textarea), can shift spacing in ways that change how the page renders. Use it on markup where whitespace is not meaningful.
Expand a one-line template into readable, indented markup.
Clean up copied HTML before pasting it into your project.
See the nesting of a block at a glance.
Present markup clearly in documentation or a lesson.
For a robust, parser-based reformat that cannot break valid markup, use a tool built on a real HTML parser (such as Prettier or js-beautify) in your editor. To check that HTML is valid, run it through the W3C validator. This tool is for a fast, in-browser read.
Re-indents with a regex that breaks between tags and counts nesting depth; honest that it does not build a DOM, so void elements and inline content can throw the indentation off.
JSON Formatter for developers — instant, offline-style and privacy-safe.
JSON Validator for developers — instant, offline-style and privacy-safe.
Base64 Encoder for developers — instant, offline-style and privacy-safe.
Fast, free Hash Generator that runs entirely client-side in your browser.
Fast, free UUID Generator that runs entirely client-side in your browser.
Fast, free CSS Minifier that runs entirely client-side in your browser.
It is free, private and runs entirely in your browser — no sign-up, no uploads, no limits.