Neatbo.

HTML formatter

Format HTML source with consistent indentation and review the result as text.

Browser-local processingInputHTML sourceOutputFormatted HTML textUp to 10 MiB per file · File limit: 1
  1. 1Add input
  2. 2Adjust settings
  3. 3Get your result

Tool input and files are processed in this browser without being uploaded.

Your input

or drag and drop it here

Files stay on this device. Your originals stay unchanged.

.html · .htm · .txt

Up to 10 MiB per file · File limit: 1

    0 characters · 0 bytes
    Options

    Complete the required options first. You can keep the defaults for the rest.

    Choose two or four spaces for indentation. Prettier also controls line wrapping, so the result may change more than leading spaces.

    Set Prettier’s string-quote preference. It can affect supported embedded JavaScript and CSS; it does not force every string or HTML attribute to use the selected quote.

    Inputs are kept temporarily in this tab when switching tools. Refreshing or closing clears them; large results may need to be regenerated.⌘ / Ctrl + Enter to run

    Preparing the tool…

    Before you start

    Format HTML source locally with Prettier, including supported embedded JavaScript and CSS. The result is displayed as code text; its markup and scripts are not run. Formatting is not validation, and embedded-code errors may not stop a result from being produced.

    How to use this tool

    1. Paste source into “HTML input” or select a local UTF-8 file. Clear the pasted text to use a selected file, or remove the file to use pasted text alone.
    2. Choose Indentation and String quote preference, then select “Format HTML”.
    3. Review the complete formatted source, then use “Copy result” or download formatted.html. Check embedded scripts and styles before using the result.

    Supported inputs and limits

    Paste up to 1 MiB of UTF-8 text, or select one file up to 10 MiB. Nonempty pasted text takes priority over the file; clear the text to format the file instead.

    Filenames are limited to 512 UTF-16 code units; some characters, including emoji, use two. A selected file is still checked and read even when pasted text takes priority. When used as input, the file must decode as UTF-8.

    Worked example

    Example input

    <div><p>Hello</p></div>
    Example options
    {}

    Example output

    <div><p>Hello</p></div>
    

    When something does not work

    Check the input size, filename and formatting options. For a formatting error, review the source; when using a file, save an external UTF-8 copy and select it again if needed. Remove a file you are not using. After changing the input, format again to update the result; after cancelling, you can start another run.

    Frequently asked questions

    Are my files uploaded?

    No. Input is processed in your browser. The same tab may temporarily retain a workspace while you switch tools, subject to memory limits. Refreshing or closing the tab clears it. Download any formatted source you want to keep.

    Does a successful result validate the HTML and embedded code?

    No. This tool formats source; it does not validate the page or run its scripts. An error while formatting embedded JavaScript or CSS may not be reported as a failure of the whole task. Review the output before using it, especially scripts, styles and whitespace-sensitive content.

    Does the quote setting affect only JavaScript?

    No. The setting is passed to Prettier as a global string-quote preference, and supported embedded CSS can use it too. It is a preference, not a rule that rewrites every quote character. Review embedded code as well as the HTML.

    Documentation & further reading

    Related tools