JSON Converters Code Gen Formatters All tools Browse all tools built byAbhay Darji

HTML Formatter & Beautifier

Format and beautify HTML with consistent indentation. Free, private and instant.

100% client side No upload No size limit Works offline
Input
Output
Ready
Drop a file to load it

About this tool

Reformat HTML with clean, consistent indentation. HTML is the markup language of the web, and forgiving parsing, rich semantics and universal rendering make it readable once it is laid out properly — which is exactly what minified or machine-generated HTML is not.

When you would use it

  • Making a minified HTML document readable
  • Normalising indentation before committing
  • Inspecting HTML returned by a service

Worked example

Minified HTML
<div class="card">
  <h2>Ada Lovelace</h2>
  <p>Score: <strong>91.5</strong></p>
</div>
Formatted
<div class="card">
  <h2>Ada Lovelace</h2>
  <p>Score: <strong>91.5</strong></p>
</div>

Things worth knowing

  • Void elements such as <br> and <img> are never given a closing tag.
  • The contents of <pre>, <script>, <style> and <textarea> are preserved byte for byte.
  • Inline elements stay on the same line as their surrounding text.
Questions

Frequently asked

Will formatting change what my HTML means?
No. Only insignificant whitespace changes. The exception is whitespace-sensitive elements such as <pre>, which are left untouched.
Is my data uploaded anywhere?
No. Every tool on JSONWorks runs entirely in your browser using JavaScript. Your input is never sent to a server, never logged and never stored. The simplest proof is to disconnect from the internet — the tools keep working. The site does load Google Fonts and a Google Analytics page-view tag, so you will see those two requests in your network tab, but neither receives anything you type or paste.
Does it work offline?
Yes. JSONWorks is installable as a progressive web app and caches itself on first visit, so every tool keeps working without a connection.
Related

Tools that pair well with this