Format XML Online

Instantly beautify and indent XML. 100% client-side — your data never leaves your browser.

Rules:Smart QuotesConverts curly quotes (“” ‘’) to straight quotes. Always active.Non-Breaking SpacesReplaces non-breaking spaces (U+00A0) with regular spaces. Always active.Line EndingsNormalizes CRLF → LF and trims trailing whitespace per line. Always active.Removes invisible zero-width characters (U+200B, U+200C, U+200D) that silently break string comparisons.Strips the Byte Order Mark (U+FEFF) that causes “invalid character” errors in parsers and editors.Removes soft hyphens (U+00AD) from PDFs that show as garbled characters in code editors.Converts mixed tabs/spaces to a consistent indent width. Click to pick a size.Collapses all line breaks into one continuous paragraph. Great for reflowing PDF or email text.Control blank line density. Click to pick Keep 1 or Remove all.Text never leaves your browser
0 characters

Format & Indent

Instantly reindents any XML — flattened, minified, or hand-edited. Choose 2-space or 4-space indentation to match your codebase style.

100% Private

All formatting happens in your browser. No server, no logs. Your XML configs, data feeds, and API payloads never leave your device.

Handles Large Files

Drop an XML file directly into the tool. Handles multi-megabyte documents like RSS feeds, SOAP responses, and Maven POMs without slowing down.

How to Format XML Online

  1. Paste your XML into the text area above, or drag and drop an .xml file. The tool auto-detects XML and switches to Format XML mode automatically.
  2. Choose indentation. Select 2-space (common for web configs) or 4-space (common in Java/Maven projects) indentation from the options bar.
  3. Copy the result. Click “Copy Clean Text” or press Ctrl+K to copy the formatted XML to your clipboard. You can also download it as an .xml file.

What is XML Formatting?

XML (eXtensible Markup Language) is a structured text format used in countless systems — SOAP web services, RSS and Atom feeds, Android manifests, Spring configuration, Maven pom.xml files, SVG graphics, and many more. Like JSON, XML in production or network responses is often minified — stripped of whitespace to reduce payload size. This makes it unreadable to humans.

Formatting (also called “indenting” or “pretty-printing”) adds consistent indentation and line breaks so the hierarchical structure becomes clear. Each nested element is indented relative to its parent, making it easy to spot unclosed tags, incorrect nesting, missing attributes, or unexpected content.

Common XML Formats We Handle

The formatter works with any well-formed XML, including:

FormatCommon Use
SOAPWeb service request/response envelopes
RSS / AtomBlog and podcast feed syndication
Maven POMJava project build configuration
Android ManifestAndroid app permissions and components
SVGScalable vector graphics markup

XML Indentation Options

2-space indentation is common in web projects, front-end tooling, and XML configs used alongside JSON or YAML. It keeps files compact while still making structure clear.

4-space indentation is the standard in many Java and enterprise contexts — particularly Maven pom.xml, Spring XML, and Android manifests. It provides more visual breathing room for deeply nested elements with long attribute lists.

Frequently Asked Questions

Is my XML data sent to a server?

No. Unformat.online processes all XML entirely in your browser using the xml-formatter library. Your data never leaves your device. Verify by opening the Network tab in DevTools — zero requests are made during formatting.

What's the maximum XML size I can format?

There is no hard limit. The tool handles multi-megabyte XML files directly in the browser. For very large files (10MB+), formatting may take a moment depending on your device.

Can I drop an XML file instead of pasting?

Yes. Drag and drop any .xml file onto the text area and it will be loaded and formatted automatically. This works for large files where copying and pasting is impractical.