Format HTML
Format and indent HTML code to make it readable, using the Prettier engine.
Processed on your device. Nothing is sent to any server.
Format compact or poorly indented HTML code to make it readable, using Prettier's formatting engine directly in your browser.
Uses the same formatting engine as Prettier, one of the most widely used code formatters, to give HTML consistent indentation.
Use cases
- Formatting HTML generated by a tool or exported without indentation.
- Preparing a readable HTML snippet for documentation.
- Visually reviewing the structure of complex HTML.
How it works
- 1
Paste your HTML
Type or paste the HTML code into the input box.
- 2
Format it
Click Format and copy or download the result.
Frequently asked questions
- Does it execute the HTML or just format it?
- It only formats it as text; the HTML you enter is never rendered or executed, so it's safe to paste code from an unknown source.