Quecko Logo

Free tool • Runs in your browser

HTML formatter

Format messy or minified HTML with consistent indentation.

Loading tool...

Quick answer

Each element is placed on its own line and nested with your chosen indent. Content inside pre, textarea, script and style stays untouched, because whitespace can matter there.

How to use it

  1. Paste your HTML.
  2. Choose the indent size.
  3. Copy the formatted HTML.

Example

Input
<div><p>Hello</p></div>
Output
<div>
  <p>Hello</p>
</div>

Common errors and how to fix them

The indentation looks off
Check for unclosed or mismatched tags in the source.

Frequently asked questions

How do I format HTML online?

Paste your HTML here, choose an indent size, and copy the result.

How do I format HTML in VS Code?

Press Shift+Alt+F on Windows, Shift+Option+F on a Mac, or Ctrl+Shift+I on Linux in an HTML file.

How do I format HTML in Notepad++?

Use a plugin such as XML Tools or a beautifier, or paste your code here.

How do I format HTML in Visual Studio?

Open the file and use Edit, Advanced, Format Document.

How do I format HTML in IntelliJ?

Use Reformat Code, with Ctrl+Alt+L on Windows or Cmd+Option+L on a Mac.

How do I format minified HTML?

Paste the minified code here, and each element is placed on its own indented line.

Does it fix invalid HTML?

No. It only changes whitespace between tags, so unclosed tags can make the indentation look wrong.

Does it change code in pre or script tags?

No. Content in pre, textarea, script and style stays untouched, as whitespace can matter there.

Can formatting change how a page looks?

Yes, slightly. New line breaks can add small gaps between inline elements, so check the result.

Is what I paste uploaded?

No. Everything runs in your browser and nothing is sent to Quecko.

More developer tools

Need something built for your business?

Quecko designs and builds AI, Web3 and custom software products.

Start a Project