Skip to content

XML Formatter

Format XML with namespace-aware syntax checks, preserved mixed text and CDATA, explicit whitespace policies, local processing and clear error recovery.

Choose your path

Built around the job you need to finish

Review XML 1.0 with namespace-aware errors and explicit whitespace policy while preserving original mixed content and protected lexical spans.

XML documentation author

Keep inline words, punctuation and CDATA unchanged.

Format mixed text and xml:space examples, compare both editors and copy the reviewed output.

Text and protected subtrees remain exact without partial output.

Configuration maintainer

Choose whether existing whitespace may be changed.

Compare preserve, structural reindent and compact modes with tabs/CRLF, then test an undeclared namespace.

Receives explicit layout boundaries and recoverable syntax errors.

Mobile reviewer

Inspect XML without hidden destructive transformations.

Use labeled narrow-screen settings, change source, rerun and download current output.

Editors stack, stale output disappears and local-only retention is clear.

Authoritative checks for this tool

Outputs and checklists are planning aids. Review the linked current authorities and the records, terms, instructions, and requirements that apply to your exact situation before a consequential decision.

Was this tool helpful?

Reference & details

How it works

Check well-formedness first

Saxes 6.0.0 checks XML 1.0 and namespaces before any output. DTDs, XML 1.1, malformed entities and duplicate attributes are refused; no external entity is fetched.

Retain original lexical spans

The formatter lays out original tag spans rather than serializing decoded values. Mixed content, CDATA and xml:space="preserve" subtrees remain exact. Existing text is preserved by default; structural reindent/compact modes require an explicit selection.

Review bytes and limits

Layout can add whitespace text nodes and changes bytes. This is not schema validation, canonicalization or signature preservation. Limits: 100,000 input characters, 500,000 output, 128 levels, 10,000 elements, 30,000 parts and 10 seconds.

Updated: August 2026

Example Scenarios

Keep punctuation and spacing around inline elements and CDATA while preparing an XML example.

Indent a text-free element tree or explicitly reindent known structural whitespace; compare attributes and namespaces.

Locate a mismatched tag or undeclared prefix, correct the source and rerun without copying partial output.

FAQ

Default mode preserves every existing text node, including whitespace-only text. Mixed-content and xml:space="preserve" subtrees are always retained. Select structural reindent only when the consumer permits whitespace changes.

No. It removes only whitespace in element-only layout candidates. It retains mixed text, CDATA and protected subtrees. Signed documents and whitespace-sensitive consumers need independent review.

No. They are explicitly refused. The workspace checks XML 1.0 well-formedness and namespaces but does not validate a DTD or schema.

Processing uses a local worker with no automatic history or Project save. Parser assets may require a connection on first use. Remove secrets before using a web utility.

Compare source and result, then copy or download XML text. If clipboard permission fails, select the result and use the system copy shortcut. Changing source or settings clears the old result.

About XML Formatter

Review XML 1.0 without treating angle brackets as a formatting shortcut. Compare original and formatted text, choose a whitespace policy and resolve explicit errors before copying.