TEXT & DEVELOPER / FREE BROWSER TOOL

Format XML

Check XML syntax and indent elements for inspection.

Files are processed in this browser and are not uploaded to YYY Tools.Details
Opening workspace

About Format XML

Use the XML formatter online to inspect compact markup. Keep two-space indentation or pretty print XML with 4 spaces. The ordered parser keeps element sequence, attributes, comments, and CDATA, but pretty printing is not a byte-preserving operation.

How to format a compact XML document

  1. Paste XML containing one root element without DOCTYPE or entity declarations.
  2. Choose the indentation width and select Process.
  3. Review the formatted source, especially whitespace-sensitive content, before downloading.

A practical example

Input
<root><name>Ada</name></root>
Result
<root>
  <name>Ada</name>
</root>

Indentation can add whitespace text nodes. Keep the original for signatures or whitespace-sensitive uses.

Supported input and limitations

  • Input is limited to 1 MB, 100,000 elements, and 80 levels. DTDs, entity declarations, and reserved __proto__ element names are not accepted.
  • Formatting can change whitespace, mixed text, declarations, and empty-tag presentation. Do not use the result to preserve XML signatures, canonical XML, or exact application semantics.

Processing happens on your device. Read about local processing and optional workspace recovery.

Frequently asked questions

Does XML formatting validate an XSD schema?

No. The tool checks basic XML syntax, not a document type, namespace policy, or XSD schema.

Can formatting XML invalidate a digital signature?

Yes. Added or changed whitespace can affect signed content. Use the signing protocol's own canonicalization and validation tools.

Related tools