Convertur

HTML beautifier and formatter

HTML beautifier that formats minified or tangled HTML with proper indents and line breaks, using Prettier's HTML parser. Runs in your browser.

Loading tool...

How to beautify HTML

Paste HTML into the input pane and click Convert. Prettier's HTML parser reads it in your browser and prints every element on its own line with two-space nested indentation, breaking long attribute lists over several lines. Deeply nested pages, email templates and component markup become easy to read and edit. Copy the result or download it as an .html file.

Why beautify HTML

Server-rendered or minified HTML is often one long line. Formatting shows the DOM structure so you can find and change elements.

Formats inline CSS and JS too

Prettier also formats <style> and <script> blocks, so the whole document is consistent.

When to use it

Read the HTML a server or a site builder produced, inspect a minified email template, clean up markup copied from a browser's developer tools, or review a component before you commit it. Prettier also formats the CSS inside style tags and the JavaScript inside script tags, so the whole file follows one style.

Before you start

Input: HTML and HTM. Output: Formatted HTML. The settings appear before anything runs, so you can check them first. Your original file is never changed.

The value you enter is processed in your browser. Still test the output where it will be used. Clean formatting does not prove the data is safe or correct.

Keep the original until you have opened and checked the result. The work happens in this browser tab, so the size you can handle depends on your device's memory, your browser and the file itself.

How to use the HTML beautifier and formatter

  1. Paste your HTML into the input pane.
  2. Click Convert to format it.
  3. Copy the markup or download it as an .html file.

Last updated · How we build and check tools · Report an error

Learn more

Related tools

HTML Beautifier FAQ