sitekits.dev
press ⌘K to switch tools
FORMAT & CONVERT

HTML Formatter

Reformat minified or messy HTML into readable, indented markup.

local
html-format
§01 ABOUT THIS TOOL

Overview

This tool pretty-prints HTML with js-beautify, the same engine behind many editor extensions. Nested elements are indented two spaces per level, tags are placed on sensible lines, and blank lines you already had are kept. It does not wrap long lines, so attribute-heavy tags remain intact. Useful for reading minified page sources, tidying CMS or email-template output, and normalizing markup before a code review diff.

How to use

  1. Paste your markup into the HTML field — minified or single-line input is fine.
  2. The beautified result appears in the Formatted field instantly as you type.
  3. Copy the output from the read-only field.

Examples

  • <div><p>hello</p><span>world</span></div>

    <div>
      <p>hello</p>
      <span>world</span>
    </div>
    

Notes

This is a formatter, not a validator: unclosed or misnested tags are indented on a best-effort basis without warnings. Embedded <script> and <style> blocks are indented along with the document. For whitespace-sensitive HTML (inline-block layouts, <pre> content), verify rendering after formatting.

FAQ
Is my HTML sent to a server?
No. Formatting runs entirely in your browser using the js-beautify library. Markup containing customer data, tracking IDs, or unreleased pages never leaves your machine.
Will formatting change how the page renders?
Almost never, but not strictly never. HTML whitespace is mostly collapsed by browsers, so re-indenting is safe for typical markup. Whitespace-sensitive contexts — inline elements separated by spaces, or pre and textarea content — can be affected by any reformatter, so diff the output for such pages.
What are the formatting settings?
Fixed defaults: two-space indentation, no forced line-wrapping (long lines stay long), and existing blank lines between blocks are preserved.