Skip to content

Install ALink Tools

Free browser tools for images, PDFs, media, text and web checks. Most tools process files locally on your device.

  1. Tap the Share button in the Safari toolbar.
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add. ALink Tools then opens from your Home Screen like an app.

HTML Formatter

Indent an HTML document so it is readable, or minify whitespace. js-beautify runs in this tab. The markup is not rendered and not sanitized.

Runs in your browserjs-beautify (MIT)Not a sanitizer
1

HTML

Limits

  • The input is limited to 2 MB of UTF-8 text (8 MB if you load a file). Larger files can run out of memory in a phone browser tab.
  • Not a sanitizer, HTML validator or accessibility checker.
  • Malformed HTML may be auto-corrected in surprising ways or left messy.
  • Huge pages, or pages with very large inline scripts, may be slow.
  • Templating languages (Handlebars, Vue, Angular, PHP mixed in HTML) are not first-class and may wrap poorly.
2

Formatted HTML

How to use HTML Formatter

  1. Paste HTMLType, paste or load an .html file.
  2. Choose indent or minifySet the indent size, or minify ignorable whitespace.
  3. Copy or downloadCopy the result or download an .html file.

HTML, not a live preview

js-beautify’s HTML beautifier reprints tags with consistent indent and will also format <script> and <style> contents with its JS and CSS beautifiers. It tries to respect void tags and preserve the text inside preformatted elements, but it is not a full HTML5 parser.

The result is not executed, and it is not passed through a sanitizer. Do not treat formatting as a security fix.

Frequently asked questions

Is my text or file uploaded?

No. Everything runs in your browser tab with JavaScript. Nothing you type, paste or drop is sent to a server, logged or stored by ALink Tools.

Will this make unsafe HTML safe?

No. It only changes whitespace. Scripts, event handlers and unsafe URLs stay in the output.

Why did my template tags wrap strangely?

js-beautify expects HTML. Mustache, Vue and similar interpolations are not a supported syntax.

Is this the same as the XML formatter?

No. Use XML Formatter for well-formed XML. This page is aimed at HTML.

Related tools

All tools