XML Formatter & Validator — Pretty Print or Minify XML
Indent, minify and validate XML, with the exact line and column of any well-formedness error. Free, no sign-up, and your files never leave your device.
Free, with no sign-up and no watermark. The file is processed in your browser and never uploaded.
Indent messy XML so its structure is clear, or minify it for production. Before formatting, the XML is checked for well-formedness, and any problem — a tag that isn't closed, a stray & — is reported with line and column. Comments, CDATA sections and processing instructions are preserved.
Step by step
- Paste or open XML: Works with .xml, .svg, .xsd, .rss and similar files.
- Choose Beautify or Minify: Beautify indents with 2 or 4 spaces or tabs; Minify strips whitespace between tags and comments.
- Check validity: A tick confirms the XML is well-formed; otherwise the error shows where.
- Copy or download: Save the result as
formatted.xml.
Handy for
Reading API responses
Make SOAP or REST XML readable.
Cleaning SVG
Format SVG files to edit them by hand.
Sitemaps and feeds
Check that a sitemap or RSS feed is well-formed.
Smaller files
Minify XML before shipping it.
Good to know
Elements that contain only text stay on one line, e.g.
<to>Team</to>.Well-formed doesn't mean schema-valid: the tool checks XML syntax, not an XSD or DTD.
Questions
Does minifying change my data?
It removes whitespace between tags and comments. Text inside elements is kept. If whitespace between elements matters to your application (rare), keep the formatted version.
Is my data sent anywhere?
No. Everything is processed by JavaScript in your browser tab — nothing you paste or open is uploaded, logged or stored on a server. You can even use the tool offline once the page has loaded.
More Developer Tools tools
- SQL Formatter — Format SQL for MySQL, PostgreSQL, SQL Server, SQLite, BigQuery and more, with keyword case control.
- HTML, CSS & JavaScript Formatter — Beautify HTML, CSS, JavaScript, TypeScript and JSON with Prettier, running entirely in your browser.
- JavaScript, CSS & HTML Minifier — Minify JavaScript with Terser, CSS and HTML safely, and see exactly how many bytes you saved.
- Base64 Encoder & Decoder — Encode and decode Base64 for UTF-8 text and any file, including the URL-safe variant.
- Image to Base64 Converter — Convert images into Base64 data URIs with ready-to-paste HTML and CSS snippets.
- Base64 to Image Converter — Paste a Base64 string or data URI to preview the image, detect its type and download it.