XML Beautifier & Validator

Paste XML — a metadata file, package.xml, SOAP message or WSDL — to format, check or minify it. Values, attributes and CDATA stay exactly as written.

Output
Indent
Beautified

Runs in your browser — nothing you paste is sent to us or stored.

How to use it

  1. 1

    Paste or open the XML

    A flow, profile or other metadata file, a package.xml, a SOAP request or response, or a WSDL.

  2. 2

    Pick the output

    Beautify with 4 spaces (how Salesforce writes its own files), 2 spaces or tabs, or minify to one line. Comments can be kept or removed.

  3. 3

    Fix, copy or download

    If the XML is broken, the message names the line and column and “Show me” puts the cursor there.

Questions

Will it format Salesforce metadata the way Salesforce does?

With 4-space indent it matches files from sf project retrieve: one element per line, and elements that hold only a value — <field>Account.Name</field> — kept on one line. Attribute values, entities like &amp; and CDATA stay exactly as written.

Why is my XML not well-formed?

Common causes: a tag closed in the wrong order, a bare & (write &amp;) or < (write &lt;) in a value, an attribute value without quotes, the same attribute twice, or two root elements. The message names the line, the column and the problem.

Does it validate against a schema (XSD)?

No — it checks that the XML is well-formed, which is what most errors are. Whether a metadata file has the right elements for its type is checked by Salesforce when you deploy.

Can formatting change what the XML means?

Only whitespace between elements changes. An element that holds just text keeps that text exactly. Where text is mixed in between child elements, it’s trimmed onto its own line — rare in metadata and SOAP, but it matters for documents where spacing inside text counts.

Is my XML sent anywhere?

No. Files you paste or open are formatted in your browser; nothing is uploaded or stored. No DTDs or external entities are ever loaded.

Further reading

Want to go beyond the tools?

Learn Salesforce development — live classes with people who build on Salesforce every day.

See the learning path →