Beautify XML Without Uploading
Format a well-formed XML document with a two-space indent so it is easier to read. You can keep attributes (the default) or ignore them. If the input is not valid XML, you get an error with a line and column instead of a half-formatted file.
This tool runs in your web browser: your files and text are processed on your device and are not uploaded to TidyKit servers. Free, no sign-up.
How to format XML
1. Paste your XML. 2. Leave “preserve attributes” on unless you deliberately want attributes dropped. 3. Copy the indented result, or read the error if the document is not well-formed.
`<root><item id="1">Ada</item></root>` becomes a multi-line tree with the `id` attribute still there when preservation is on.
How formatting works
The document is parsed and then rebuilt, so whitespace inside the original file is not treated as sacred. This is a formatter for well-formed XML, not a schema-aware pretty printer. The text never leaves this tab.
Frequently asked questions
What if my XML is invalid?
You will see a message such as “Invalid XML: … (line 4, col 12)” instead of formatted output.
Is the document uploaded?
No.
Can I change the indent size?
Not on this page. The builder always indents with two spaces.
What does “preserve attributes” do?
When it is on, attributes are kept in the rebuilt XML. When it is off, they are omitted.
More XML Tools
- XML Validator – Validate XML code for errors