FREE WEB TOOL

Format Minified HTML with Lines and Indentation

Add line breaks and indentation to compressed HTML.

Enter code

đź”’ Images and text are processed in this browser and are not uploaded.

How to use it

Turn one-line or compressed HTML into a tag-per-line layout with indentation that follows nesting. It is intended for quickly inspecting structure, not for rewriting the document semantically.

  1. Paste the HTML.
  2. Choose 2 spaces, 4 spaces or Tab if you want a different indentation width.
  3. Select Format and inspect the resulting structure.
Default
2 spaces
Indent options
2 / 4 spaces / Tab
Purpose
HTML line breaks and indentation
Processing
In browser

Make one-line markup easier to scan

Input such as <main><h1>Hello</h1><p>Text</p></main> becomes easier to follow because h1 and p are visually nested under main instead of appearing in one continuous line.

This is not a full HTML validator or repair engine. Invalid markup can still be invalid after it has been formatted.

Formatting is mainly for readability

The formatter splits markup into tag-oriented lines and changes indentation as start and end tags are encountered. That is useful for code review and quick inspection of copied fragments.

Void elements do not increase nesting

Elements such as img, br, meta and input normally do not have closing tags, so the formatter avoids treating them like ordinary container elements.

Script and style contents are not deeply reformatted

The goal is to clarify the surrounding HTML structure. JavaScript and CSS inside those elements are not parsed as if a dedicated JS or CSS formatter had been run.

Consistent layout helps with visual diffs

Two compressed HTML snippets are hard to compare. Applying the same indentation rules first makes added, removed or moved tags much easier to spot.