Toffeekit
  • Home
  • All tools513
  • Recent
  • Favorites
Categories
  • Images51
  • Video21
  • PDF33
  • AI24
  • Data21
  • SEO12
  • Developer32
  • Text27
  • Design18
  • Files13
  • Utilities5
  • Productivity17
  • Finance26
  • Math39
  • Education19
  • Date & Time29
  • Converters43
  • Fun & Random24
  • SaaS13
  • Business17
  • Social11
  • Media5
  • Security13
Buy me a coffee
ToffeekitDeveloperXML Formatter

XML Formatter

Format, validate and minify XML with exact error lines. Keeps comments and CDATA. Runs entirely in your browser, so nothing is uploaded.

Help
Runs locally Instant, no sign-up Works offline
Use cases

One click to the right settings

Format and validate XML

Indent a one-line XML file and check it's well-formed.

Minify XML

Remove whitespace between tags for a smaller file.

How it works

How to use XML Formatter

  1. 01Paste XML into the input, or click Open to load an .xml or .svg file.
  2. 02Choose Format or Minify, and an Indent of 2 spaces, 4 spaces or Tab.
  3. 03Set Empty elements, Attributes one per line and Keep comments to taste.
  4. 04Read the status line to confirm the XML is valid, then Copy or Save the result.
Questions

XML Formatter FAQ

6 answers to what people ask most about the XML Formatter.

How do I check if my XML is valid?

Paste it in. The status line shows Valid XML with the root element and element count, or the exact line, column and reason for the first error.

Does it validate against an XSD or DTD schema?

No. It checks that the XML is well-formed, meaning tags match, attributes are quoted and entities are defined. Schema validation needs the schema file and is not done here.

Will formatting change my text content?

Elements that contain only text keep it exactly as written, and elements that mix text with child tags stay on one line, so spaces aren't added inside sentences.

Are comments and CDATA kept?

Yes. CDATA sections, processing instructions and the DOCTYPE are kept as written. Comments are kept unless you turn off Keep comments.

What does xml:space="preserve" do here?

Any element with xml:space="preserve" is printed exactly as it was, including its whitespace, in both Format and Minify modes.

Is XML Formatter free and private?

Yes. It's free with no sign-up or limits, and it runs entirely in your browser, so what you type or paste never leaves your device. It works on phones and computers alike.

Something not working? Tell us and we'll fix it.

Report an issue
More tools
JSON Formatter

Format, minify and validate JSON with clear errors.

Developer
Base64 Encode / Decode

Encode text to Base64 or decode it back, UTF-8 safe.

Developer
URL Encode / Decode

Percent-encode query values or whole URLs.

Developer
HTML Entities

Escape < > & and quotes, or decode entities.

Developer
Something off with XML Formatter? Report an issue or ask for a feature.Send feedback
© 2026 Toffeekit/Runs locally · No uploads · Free
AboutContactFeedbackPrivacyTermsCookiesSettingsllms.txt