---
title: XML Formatter: Free Online Tool | Relic
description: Free XML formatter. Paste raw XML to pretty-print and indent it, with a clear error if it is malformed. Runs entirely in your browser, nothing uploaded.
canonical: https://relic.space/tools/xml-formatter
source: https://relic.space/llms.txt
---
# XML Formatter

Pretty-print and indent messy XML so it is readable, or minify it back to one line. Runs in your browser, nothing uploaded.

Runs entirely in your browser. Nothing you type is uploaded.

indent

Input

Output

Formatted XML appears here…

## Readable XML in one click

Paste a wall of **XML** and this formatter walks the tags, opening a new indented line for each element and closing it back out, so the structure is obvious at a glance. A simple element that wraps a bit of text, like a `title` tag, is kept on one line so the result stays compact. Switch to **Minify** to strip the whitespace back out for transport. Your browser also runs a real well-formed check on the side, so you get a nudge if a tag is unclosed or mismatched, while valid text that contains an angle bracket is left alone. It all happens in your browser.

## For the configs and payloads you keep reopening

That one XML config or API response always comes back around. **Relic** keeps an end-to-end encrypted, searchable history of everything you copy, on every device, for as long as you want it. The formatter is free, and the snippet you just cleaned up is one search away the next time you need it.

## Frequently asked questions

How do I format XML?+

Paste your raw XML into the input box and the formatter pretty-prints it instantly, giving each element its own indented line so the nesting is easy to read. Pick a 2 or 4 space indent, or switch to Minify to strip the whitespace back out into a single line. Everything happens live in your browser as you type.

How does the formatter decide where to indent?+

It walks the tags in order, adding a level of indentation each time an element opens and removing one when it closes. A simple element that just wraps a bit of text, like a title tag around a single value, is kept on one line so the output stays compact. Self-closing tags and declarations do not change the depth.

What makes XML well-formed?+

Well-formed XML has exactly one root element, every open tag has a matching close tag (or is self-closed), tags nest without overlapping, and attribute values are quoted. This tool runs a real well-formedness check in your browser using the built-in DOMParser, so you get a "Well-formed" or "Not well-formed" flag alongside the output. Note that well-formed is not the same as valid against a schema or DTD, which this does not check.

Will it fix broken or malformed XML?+

Not exactly. It is a fast convenience formatter built on tag matching with regular expressions, not a full validating parser, so it will still indent input that has an unclosed or mismatched tag and simply warn you that the result is a best effort. Treat the well-formed flag as your signal to go find the real problem in the source.

Is my XML uploaded anywhere?+

No. Both the formatting and the well-formed check run entirely in your browser, so your XML never leaves your device and there is no server round trip. That makes it safe for config files or API payloads you would rather not paste into a random website.

You just copied that. What if you never lost it?

**Relic** remembers everything you copy, forever, searchable on every device, and  end-to-end encrypted so only you can read it.

 250 MB free

[Download forWindows](https://relic.space/download/windows)[Download formacOS](https://relic.space/download/macos)[Download forLinux](https://relic.space/download/linux)[Download forAndroid](https://play.google.com/store/apps/details?id=relic.space.app&referrer=utm%5Fsource%3Drelic.space%26utm%5Fmedium%3Dwebsite%26utm%5Fcampaign%3Dcontent)[Download foriPhone](https://apps.apple.com/us/app/relic-clipboard-vault/id6800556025)

More free tools

[JSON Formatterjson formatter](https://relic.space/tools/json-formatter)[Base64 Encode / Decodebase64 decode](https://relic.space/tools/base64)[Diff Checkerdiff checker](https://relic.space/tools/diff-checker)[URL Encode / Decodeurl decoder](https://relic.space/tools/url-encode-decode)[UUID Generatoruuid generator](https://relic.space/tools/uuid-generator)[Epoch Converterepoch converter](https://relic.space/tools/epoch-converter)[All tools](https://relic.space/tools)
