Skip to content
Kordu Tools Kordu Tools

HTML Formatter

Runs in browser

Format and beautify messy HTML with configurable indent, wrapping, and attribute handling — paste or type, get clean output instantly.

Last updated 08 Apr 2026

Paste messy or minified HTML and get clean, properly indented code in one click. Configure indent size (2, 4 spaces or tabs), max line length, and attribute handling. Runs entirely in your browser — nothing is sent to a server.

Indent
Wrap atchars
1 line
Loading rating…

How to use

  1. 1

    Paste your HTML

    Paste messy or minified HTML into the input area, or try one of the sample snippets.

  2. 2

    Configure formatting

    Choose indent size (2 or 4 spaces, or tabs), max line length, and how attributes and inline elements are handled.

  3. 3

    Format and copy

    Click Format to produce clean, indented HTML. Copy the result to your clipboard with one click.

Frequently asked questions

Is my HTML sent to a server?
No. Formatting runs entirely in your browser using js-beautify. Your code never leaves your device.
Does it work with partial HTML?
Yes. You can format a full document, a single component, a table fragment, or any valid (or even slightly invalid) HTML snippet.
Does it fix broken HTML?
The formatter fixes indentation and whitespace but does not repair structural errors like missing closing tags. For that, use an HTML validator.
What formatting engine is used?
js-beautify — the same library used by VS Code's built-in HTML formatter and many popular editor extensions.
Can I format embedded CSS and JavaScript?
Yes. js-beautify automatically detects inline <style> and <script> blocks and formats their contents using the appropriate rules.
Does it handle SVG markup?
Yes. SVG elements inside HTML are formatted with proper indentation like any other nested element.

Clean up messy, minified, or badly indented HTML instantly. Paste your code,

choose your formatting preferences, and get beautifully structured output with

proper indentation, consistent attribute alignment, and clean line wrapping.

Powered by js-beautify, the same engine behind VS Code's built-in HTML

formatter. All processing runs in your browser — your code never leaves your

device.

Who is this for: front-end developers debugging production HTML, designers

inspecting page source, students learning web development, and anyone who needs

to make HTML readable. Works with complete documents or code fragments — head

sections, component templates, email markup, and embedded SVGs.

Related tools