Structural indenting
Nesting depth drives the indent, so a missing closing tag shows up as a visible step in the wrong direction rather than hiding in a wall of text.
Paste messy, minified or exported HTML and get back clean, indented, readable code. Nothing is uploaded — the parsing happens on your own device.
It reads your HTML into a tree, then prints that tree back out with one element per line and
a fresh indent at every nesting level. Because it works on the parsed structure rather than on the raw text,
it can tell the difference between a tag and a > inside an attribute value — which is where
most search-and-replace tidying attempts fall over.
<!DOCTYPE html><html><head><title>Notes</title></head><body><div class="wrap"><h1>Reading list</h1><ul><li>Typography<li>Grid systems</ul><p>Updated <time datetime="2026-04-02">April</time>.</p></div></body></html>
<!DOCTYPE html>
<html>
<head>
<title>Notes</title>
</head>
<body>
<div class="wrap">
<h1>Reading list</h1>
<ul>
<li>Typography</li>
<li>Grid systems</li>
</ul>
<p>Updated <time datetime="2026-04-02">April</time>.</p>
</div>
</body>
</html>
Short elements that only hold text stay on one line, so you do not end up with a thousand-line file where
every <li> takes three rows. Anything long enough to need it gets broken out and indented.
Same two-panel layout, a different parser behind each one. HTML, JSON, CSS and XML all have their own rules about what counts as structure, and a tool that guesses gets them wrong.
Indent and structure any HTML file.
OpenTurn minified HTML back into readable code.
OpenPretty-print HTML with the indent you want.
OpenFormat, inspect and repair JSON.
OpenLay out stylesheets with consistent indentation.
OpenIndent XML, RSS and SVG documents.
OpenBeautify minified or messy JavaScript.
OpenStrip a file down for production, or find out why it will not parse. Every problem is reported with the line number it came from.
Strip whitespace and comments from HTML.
OpenCompress stylesheets for production.
OpenRemove every unnecessary byte from JSON.
OpenStrip comments and whitespace, safely.
OpenFind unclosed tags and broken nesting.
OpenLocate the exact line a JSON parse fails on.
OpenTidy exports from CMS and email builders.
OpenMove code and text between formats — HTML into React, plain text into Base64, a value into something safe to put in a URL.
Convert HTML into React-ready JSX.
OpenEncode and decode Base64, including data URIs.
OpenPercent-encode and decode URLs and query strings.
OpenEscape and unescape HTML entities.
OpenEdit HTML and watch it render as you type.
OpenDrop it into the left panel, or use Open file to load an .html file
straight off your disk. No sign-in, no upload dialog to a server. If you just want to see what the tool
does, press Sample for a deliberately scruffy example.
Two spaces, four spaces or a tab. Decide whether comments survive. Switch between Beautify, Minify and Validate at the top left — the result refreshes immediately when you change an option, so you can compare settings without re-pasting.
Copy puts the result on your clipboard. Download saves it as an
.html file. Send result back to input moves the output to the left panel so
you can run a second pass — handy for beautifying first, reading the code, then minifying the same file.
Keyboard shortcut: Ctrl + Enter (or Cmd +
Enter) runs the current mode from inside the input box.
Nesting depth drives the indent, so a missing closing tag shows up as a visible step in the wrong direction rather than hiding in a wall of text.
Contents of <script>, <style>, <pre> and
<textarea> are preserved character for character and re-indented as a block.
Inline elements stay inline. A paragraph with a link in the middle of it does not get shredded across five lines the way a naive indenter would do it.
Unquoted and single-quoted attribute values are rewritten with double quotes, and tag names are lower-cased, which is the convention every modern style guide agrees on.
Character count in, character count out, and the percentage difference. Useful when you are minifying and want to know whether it was worth it.
Validate reports unclosed tags, stray closing tags, duplicate id values and images with no
alt, each pinned to the line it came from.
A template from a contractor, a component pulled out of a framework build, a page saved from production — all of it arrives shapeless. Formatting is the first thing you do before you can reason about it.
Exports from Mailchimp, Klaviyo and Campaign Monitor are nested tables with inline styles. Indenting them is the difference between finding the cell you want to edit in ten seconds and in ten minutes.
Running your own work through a formatter shows you your nesting as the browser sees it. If the indent does not match the structure you had in your head, you have found a bug in your mental model.
Auditing heading order, structured data or meta tags on a live page means reading its source. Formatted source is readable source.
WYSIWYG editors leave behind empty spans, duplicated wrappers and stray <br> tags.
Seeing the markup laid out is how you spot them.
Scraped pages, server-rendered output and API responses that return HTML fragments all need to be read before they can be judged.
Yes. Every mode — beautify, minify, validate — is free with no account, no usage cap and no paid tier. The site is funded by advertising, which is why you will see ad slots on the page.
No. The parser and printer are JavaScript files that your browser downloads once and then runs locally. Nothing you paste is sent to a server, logged or stored. You can open your browser's network tab and watch: pressing Format makes zero requests. It also means the tool keeps working if you go offline after the page loads.
Beautify only moves whitespace between tags, so the rendered result is identical — with one exception worth knowing about. Whitespace inside a line of text is meaningful in HTML, so the formatter never touches the contents of <pre> or <textarea>. Minify is more aggressive: it removes comments and collapses runs of whitespace, which can close up the small gap browsers render between inline elements such as <span> or <li> when they sit on separate lines.
Everything runs on your own CPU, so the ceiling is your device rather than a server quota. Files up to a few hundred kilobytes format in well under a second on a normal laptop. Much beyond a megabyte and a desktop browser will be noticeably happier than a phone.
It can survive broken HTML and tell you where the breakage is, which is usually what you need. The parser recovers from unclosed tags and stray closing tags rather than giving up, and the Validate mode lists each problem with a line number. It does not silently rewrite your markup to make it valid — guessing at intent tends to make the real bug harder to find.
It leaves their contents alone and re-indents them as a block. JavaScript and CSS have their own formatting rules, and a naive HTML indenter that reformats the inside of a <script> tag will break template literals and regular expressions. So the code inside stays exactly as you wrote it.
The formatter is at the top of this page — nothing to install, nothing to sign up for.
Longer reading on formatting, indentation and minification.