XML Formatter & Minifier
Developer
Paste XML and reformat it instantly — pretty-print it with 2 spaces, 4 spaces or tabs, or minify it down to a single line. The XML is parsed with the browser's real XML parser, so malformed documents are flagged, and comments, CDATA sections and processing instructions are preserved. Everything runs locally in your browser — nothing is uploaded.
How to use
- Paste your XML into the input box.
- Choose Beautify (and an indent size) or Minify.
- Copy the formatted XML from the output box.
Frequently asked questions
- What does beautify do?
- It re-indents the document by nesting depth so the structure is easy to read, putting each element on its own line. Whitespace between elements is normalized.
- What does minify do?
- It removes the whitespace between elements and the indentation, collapsing the document to a single line — useful for compact storage or transport.
- Does it keep comments and CDATA?
- Yes. Comments, CDATA sections and processing instructions are preserved, and special characters in text and attributes are properly escaped.
- What if my XML is invalid?
- The document is parsed with the browser's XML parser. If it isn't well-formed, an error message is shown instead of broken output.
Related tools
Base64 to Hex Converter (and back)
Convert a Base64 string to hexadecimal bytes and hex back to Base64, with URL-safe support, in your browser.
Quoted-Printable Encoder & Decoder
Encode text to MIME Quoted-Printable (RFC 2045) or decode it back — handling =XX escapes, soft line breaks, and UTF-8 — entirely in your browser, with 76-character line wrapping on encode.
Hash Generator (SHA)
Generate SHA-1, SHA-256, SHA-384, and SHA-512 hashes from text.
URL Encoder / Decoder
Percent-encode text for URLs, or decode encoded URLs back to text.
Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 back to text, instantly.
JSON Formatter & Validator
Format, beautify, minify, and validate JSON right in your browser.