CraftTools

HTML / XML Formatter & Minifier

Guide: HTML Entities, Formatting and Minifying Explained

Nothing you enter or choose here leaves your device. This tool runs in your browser.

How to use

  1. 1Choose HTML or XML, then Format or Minify.
  2. 2Paste your markup into the input box.
  3. 3Pick the indentation you prefer.
  4. 4Click Copy output.

Frequently asked questions

Does formatting change how my page looks?

Not in normal cases. It only changes whitespace between tags. Content inside <pre> and <textarea> is left exactly as written, and script and style blocks are only re-indented.

What does minifying remove?

Comments, line breaks and extra spaces between tags. Conditional comments, and everything inside <pre> and <textarea>, are kept.

What is the difference between the HTML and XML modes?

HTML mode knows about void tags such as <br> and <img> and keeps inline tags like <b> and <a> inside the line of text. XML mode treats every element as a block and keeps self-closing tags as written.

Is my markup uploaded?

No. Everything happens in your browser.

Read the guide

Learn how this works and how to get the most from it.

Web & SEO

HTML Entities, Formatting and Minifying Explained

When to escape characters in HTML, how formatting and minifying differ, and how much minifying HTML, CSS and JavaScript really saves.

1 min read

CSS Minifier & Beautifier

Compress CSS to save bytes, or format it so it is easy to read.

HTML to Markdown Converter

Convert HTML or pasted web content into clean Markdown.

Markdown Previewer

Write Markdown and see a live formatted preview side by side.

XML ⇄ JSON Converter

Convert XML to JSON and JSON to XML, keeping attributes and lists.