XML Formatter
Indent XML so the structure is easy to read, without changing text, CDATA sections or comments. Errors are pinpointed by line and column. Your XML never leaves your browser.
- Free to use
- Local processing
- Text and CDATA untouched
- 2, 4 or tab indent
- Runs on your device. Files are never uploaded.
- Free and unlimited. No sign-up, no watermark.
XML formatter in three steps
No account, no email, no waiting for an upload.
- STEP 01
Add your XML
Accepts .xml, .svg, .rss, .atom, .xsd, .xsl, .kml, .gpx, .plist and .txt.
- STEP 02
Pick the layout
Choose 2 spaces, 4 spaces or tabs, and decide whether to remove comments.
- STEP 03
Copy or download
If the XML is not well-formed, you see the line, column and reason instead.
What XML formatter does, and what it doesn't
We'd rather tell you up front than surprise you after the download.
What you get
- Content stays exactText, entities, CDATA sections and comments are copied as written. Only the whitespace between tags changes.
- Mixed content respectedElements that mix text and child tags, or have xml:space="preserve", are kept as they are so their meaning does not change.
- Tidy tagsExtra spaces inside tags are normalized to one space between attributes.
- Remove comments optionStrip comments when you want a cleaner file.
- Checks well-formedness firstMismatched or unclosed tags are reported before anything is changed.
Good to know
- Well-formed XML onlyBroken XML is not guessed at. Fix the reported problem, then format. For a full report, use the XML validator.
- No schema checksFormatting does not validate against a DTD or XSD.
- Attributes are not reorderedThey stay in the order you wrote them.
Your data never leave your device
The tool runs inside your browser instead of on our servers, so there is nothing to upload, store or delete afterwards.
Typical online tool upload
Your file travels over the internet, sits on someone else's computer for a while, and you wait for the upload and the download.
Mediaextractr no upload
The tool loads into your browser once, then works on your file locally. Nothing is sent, so nothing can leak.
When people use XML formatter
Read a SOAP or API response
Expand a one-line XML body.
Tidy SVG or sitemap files
Make hand-edited files consistent.
Clean config files
Standardize indentation across a project.
Teach nesting
Show how elements are structured.
Mediaextractr vs typical upload tools
| MediaextractrPrivate | Typical upload tools | |
|---|---|---|
| Your file is uploaded | Never | Yes |
| Sign-up needed | No | Often, after a few files |
| Daily file limit | None | Often 1–2 free files |
| Watermark | Never | Sometimes |
| Wait for upload & download | No | Yes |
| Speed on very large files | Depends on your device | Depends on their servers |
What formatting changes
The formatter puts each element on its own line and indents children one level deeper. Whitespace between tags is the only thing it changes, and only where whitespace does not matter.
Where it could matter, as in mixed content such as paragraph text with inline bold tags, the element is left exactly as written.
Tips: XML formatter
Some habits make XML work easier:
- Validate first when the source is untrusted: the XML validator also summarizes the document.
- Minify again for transport with the XML minifier.
- Convert to something easier to query with XML to JSON.
- Remember that entities such as & stay exactly as they were typed.
Formatting without surprises
Some XML dialects are whitespace-sensitive, for example documents with mixed content or xml:space set to preserve. The formatter leaves those elements exactly as written, so the meaning is unchanged. If you see an element that was not re-indented, that is why. Everything else is laid out one element per line.
Questions, answered
How do I format XML online?
Paste the XML, pick an indent and copy the formatted version.
Does formatting my XML upload it?
No. The XML is tokenized and re-indented by script in this tab. Config files and feeds stay on your device.
Does formatting change my data?
No. Text, attributes, CDATA and comments are preserved. Only layout whitespace changes.
What if my XML has an error?
You get the line and column, with a short reason such as a mismatched closing tag.
Can it remove comments?
Yes. Turn on 'Remove comments'.
Can I use it in a phone browser?
Yes. Paste the XML, pick an indent and copy the result in a current phone browser.