Nouplo

HTML formatter

Indented so you can read it, or squeezed so you can ship it.

Output
Paste or type above to see the result here.

Your files stay on your device

This tool runs entirely in your browser. What you paste is processed on your device and is never sent to a server, so it is safe to use with tokens, keys and unpublished text.

How it works

  1. Paste the HTML. It is laid out as you type.
  2. Switch to “squeeze it down” to strip the indentation and the comments instead.
  3. Choose two spaces, four, or a tab.
  4. Copy the result, or download it as a file.

Frequently asked questions

What happens to a document that is not quite valid?
It still gets formatted. This reads the markup as a run of tags and text rather than parsing it into a tree, because the HTML somebody wants formatted is usually the HTML they are trying to understand — and a tool that refuses it is no help at all. An unclosed tag comes through as it stands.
Will it break the spacing in my text?
No, and that is the fiddly part of the job. The space between <b>one</b> and <i>two</i> is rendered, so it is kept; the space either side of a <div> is not, so it goes. Inline elements stay on the line with the words around them.
Is anything inside <pre> touched?
Not one character. Every space inside <pre> and <textarea> is rendered, so the content is emitted exactly as it was typed — not even shifted left. Script and style are different: their whitespace means nothing, so those are moved under their tag.
Does minifying rename anything?
No. It removes comments and the whitespace that does not show. Nothing is renamed, nothing is reordered, and the document that comes out renders the same as the one that went in.
Is anything sent to a server?
No. It runs in your browser, so what you paste stays on your computer.

Related tools