Skip to content
Shrake DevTools
  • JSON FormatterData & Format
  • JSON ValidatorData & Format
  • JSON MinifierData & Format
  • JSON ↔ YAML ConverterData & Format
  • XML FormatterData & Format
  • Base64 Encoder / DecoderData & Format
  • URL Encoder / DecoderData & Format
  • JWT InspectorData & Format
↑ ↓ to navigate↵ to openEsc to close

XML Formatter

Format, validate and minify XML with syntax highlighting, entirely in your browser.

Runs locally in your browser. Your input is not uploaded.Free, no sign-up

Input

Output

How to use the XML Formatter

  1. Paste XML into the input editor, or click Sample for a Maven pom.xml.
  2. Choose Format to pretty-print with 2 spaces, 4 spaces or tabs, or Minify to remove the whitespace between elements.
  3. If the XML isn't well-formed, the problem line is highlighted with an explanation and a hint.
  4. Copy the result or Download it as an .xml file.

Nothing is rewritten

Many XML formatters parse the document into objects and rebuild it, which can drop comments, reorder attributes, change quotes or expand entities. This one only changes indentation between elements. Tags, attributes, entities like &, comments, CDATA sections, processing instructions and the DOCTYPE are copied exactly.

Whitespace that matters is left alone: elements that contain only text, mixed content such as <p>Hello <b>world</b></p>, and anything marked xml:space="preserve".

What it checks

  • Every opening tag has a matching closing tag, in the right order
  • Attribute values are quoted, and no attribute is repeated
  • Special characters are escaped: & as &amp; and < as &lt;
  • The document has exactly one root element

Frequently asked questions

Is my XML uploaded?

No. Formatting and validation happen entirely in your browser. SOAP payloads, configs and feeds never leave your machine.

Does it validate against an XSD or DTD schema?

Not yet. It checks that the XML is well-formed, meaning correctly structured. Schema validation (whether the elements and values are the ones a schema allows) is a separate step.

Can it format Maven, Spring, Android or SOAP files?

Yes. Any well-formed XML works, including namespaces like xmlns:soap and XML declarations.