XML Formatter

Pretty-print and validate XML with proper nesting and indentation.

Indent:
Input (XML)
Output (Formatted)

Paste XML to see formatted output…

Features

Pretty-print

Format XML with configurable 2 or 4 space indentation for clean, readable output.

XML Declaration

Optionally include the standard XML declaration header with encoding information.

Syntax Validation

Real-time validation using the browser's built-in XML parser with error location reporting.

Proper Nesting

Correctly handles self-closing tags, text nodes, comments, and complex nested structures.

All processing happens locally in your browser. No data is sent to any server.