XML Formatter

Format, minify or check one XML document using the browser's XML parser.

Inputs stay on your device No sign-up Free to use
How this works

The tool runs in this browser. Your file or text is not uploaded to UseFreeTools. Check this tool's limits for anything it may save on your device.

Privacy details

Format XML controls

Showing an example. Edit to see your own.

Well-formed XML only. HTML with unclosed tags is rejected.

Action
Indentation

Used by Format only.

Processed in your browser. Your inputs stay on this device.

How to use XML Formatter

  1. Paste one XML document into the editor.
  2. Choose Format, Minify or Validate only.
  3. Set the indentation for Format. The formatted, minified or validated XML updates as you change the input.
  4. Read the root and element count or copy the resulting XML.

Example: XML Formatter

Indent a small catalog with two items.

You add
<catalog><item>A</item><item>B</item></catalog>
You get
The catalog and two item elements appear on separate indented lines, with 3 elements reported.

Supported inputs and limits

Checks well-formedness with the browser XML parser; it does not validate against a DTD or XSD schema. DTD declarations and custom entities are refused. Formatting preserves text-bearing mixed content rather than changing its whitespace. Input is capped at 2 million characters and 200,000 nodes.

Where your input is processed

This tool processes your input in this browser. Your text and files are not uploaded to UseFreeTools. Check this tool's limits for anything it may save on your device.

Questions about XML Formatter

Can this validate an XML schema?

No. It checks whether the XML is well-formed, but does not load or validate an XSD.

Why did a paragraph remain on one line?

Spaces around mixed text and child tags can be meaningful, so the formatter leaves that content together.

Can I paste HTML here?

Only if it is also well-formed XML. Ordinary HTML may have unclosed tags or other syntax this parser rejects.

Can I use external entities?

No. This page refuses DTD declarations and custom entity definitions.

Project manager: Tony Hines · Content updated 29 September 2026 · Report a problem