Toolpuffin

    Loading...

    Up and down to choose, Enter to open, Esc to close.

    HTML Formatter and Minifier

    Paste HTML and get it back neatly indented, or squeezed into a smaller file. Useful for reading code you copied or for trimming a page before you publish it. Your code stays in your browser.

    Features

    • Formats HTML with 2 spaces, 4 spaces or tabs
    • Minifies HTML and shows how much smaller it got
    • Also formats the CSS and JavaScript inside the page
    • Runs on your device, so your code is never uploaded

    How to use HTML Formatter

    1. Paste your HTML into the box.
    2. Pick the indentation, then click Format, or click Minify.
    3. Copy the result.

    Frequently asked questions

    What does minifying HTML do?

    It removes comments and extra spaces and line breaks, so the file is smaller. The text inside script, style, pre and textarea tags is left exactly as written. Look at the result before you use it, because the tool does not rewrite your code.

    Does formatting change how my page looks?

    Usually not, but adding line breaks and spaces between inline elements can show up as a small gap in some layouts. Text inside pre and textarea tags is kept as it is.

    Does it fix broken HTML?

    No. It does not check your HTML or repair missing closing tags. If the result looks wrong, look for a tag that is not closed in the original.

    Is my code uploaded?

    No. Formatting and minifying run in your browser. The first time you click Format, the page loads the formatter it needs (about 250 KB).

    Related tools