Neatbo.

XML formatter

Indent XML structure while keeping mixed text, CDATA and comments intact.

Browser-local processingInputXMLOutputXMLUp to 10 MiB per file · File limit: 1
  1. 1Add input
  2. 2Review and run
  3. 3Get your result

Tool input and files are processed in this browser without being uploaded.

Your input

Inputs are kept temporarily in this tab when switching tools. Refreshing or closing clears them; large results may need to be regenerated.

⌘ / Ctrl + Enter to run
XML source
0 characters · 0 bytes

Check XML before formatting

Structural tags will be indented. Mixed text, CDATA and xml:space="preserve" regions remain as written.

Paste XML or select a file to begin

Preparing the tool…

Before you start

Paste compact XML or choose a UTF-8 file. Indent structural elements for inspection while preserving mixed text, CDATA, comments, processing instructions and xml:space regions.

How to use this tool

  1. Paste XML or choose one UTF-8 .xml or .txt file.
  2. Check the root and protected text regions; then format the XML.
  3. Review the whitespace warning and preview, then copy or download the complete result.

Supported inputs and limits

Indentation adds line breaks and replaces whitespace-only text between structural tags. Check whitespace-sensitive consumers before replacing the source.

Only XML 1.0 and UTF-8 are supported. DTD declarations and external entities are rejected. Paste is limited to 1 MiB, one file to 10 MiB, 200,000 elements and 128 levels.

Tag spelling, attribute quotes and entity references remain as written. Formatting does not check a business schema or repair invalid XML.

Worked example

Example input

<root><item>7</item></root>
Example options
{}

Example output

<root>
  <item>7</item>
</root>

When something does not work

Correct malformed XML or encoding, remove DTD declarations, and review whitespace-sensitive fields before replacing the source.

Frequently asked questions

Will formatting change text values?

Text-bearing and CDATA regions, including mixed content and xml:space="preserve" sections, remain as written. Structural indentation can replace whitespace-only text between child tags, so check consumers that rely on such whitespace.

Are comments, declarations and entities retained?

Yes. Comments, processing instructions, XML declarations, CDATA, attribute quotes and entity-reference spelling are retained. DTD declarations and external entities are rejected.

Can this repair invalid XML?

No. Invalid tags, namespaces, entities or attributes must be corrected first. The tool validates XML syntax, not a business schema.

Documentation & further reading

Related tools