HTML Formatter
Auto-indent and organize HTML markup for better readability.
Pretty-print XML with standardized indentation and nesting.
Detects XML nesting and indents it, 2 spaces by default. Everything runs locally in your browser.
Two-space indentation, one line per tag by depth. Whitespace between tags is collapsed first, so even a badly laid-out input comes back aligned.
Elements whose only child is text stay on one line: <title>Title</title> is not exploded into three lines, which keeps short elements readable.
The <?xml ...?> declaration, <!DOCTYPE> and comments each get their own line at the current depth, so the output is valid XML.
Paste the XML
A single-line blob or hand-formatted markup both work.
Read the depth
Each nested level indents two more spaces; self-closing tags and declarations do not shift depth.
Copy the result
Use the XML minifier when you need it compact again.
Because that element has a single text child, which reads better inline. Breaking those out would triple the document height for no benefit.
It is fixed at two spaces, the usual XML convention. Replace leading spaces in your editor if you need another width.
Auto-indent and organize HTML markup for better readability.
Minify HTML by removing extra spaces and non-essential characters.
Minify or prettify CSS code for production and maintenance workflows.
Beautify JavaScript code with consistent indentation and spacing.
Minify JavaScript to reduce file size for faster page delivery.
Format, validate, and beautify JSON for easier reading and debugging.