XML Formatter
Pretty-print, minify, and validate XML on the spot — check for well-formedness errors instantly. Also handy for inspecting SOAP/REST API responses and RSS/Atom feeds.
Tips
- Everything you type is processed entirely in your browser with JavaScript — nothing is ever sent to toolbase.cc's servers, so it's safe to format internal config files or responses containing sensitive data.
- Turning on minify mode strips all whitespace and line breaks between tags, which is handy for embedding XML into config files or shrinking an HTTP request body.
- If the output shows "Invalid XML," it's usually caused by an unclosed tag or a mismatch between an opening and closing tag name. Use the line number shown in the error list to track down the problem.
- This tool is a sibling of the JSON and SQL formatters, built on the same approach. If your API returns both JSON and XML, pairing this with the JSON Formatter can speed up debugging.
- Tag matching also accounts for namespace prefixes (e.g.
<soap:Envelope>), so this works well for debugging SOAP messages too.
Frequently asked questions
< and &.<ns:tag>, are matched including the prefix, so this validates and formats correctly even for namespace-heavy XML such as SOAP messages.
Side Note — XML, the offspring of SGML
XML (Extensible Markup Language) became a W3C recommendation in 1998, and its lineage traces back to SGML (Standard Generalized Markup Language), a sprawling document-description standard from the 1980s — XML was designed as a simplified subset of it. HTML is another SGML application, making XML and HTML siblings in the same family.
In the early 2000s, XML spread rapidly as the standard format for web APIs and business-to-business data exchange (EDI), led by SOAP. Its support for attributes, namespaces, and strict typing via XML Schema made it well suited to enterprise use cases of the era.
By the 2010s, JSON had taken over as the dominant format, but XML never disappeared. It remains the standard in domains that need rich structured-document expressiveness: RSS/Atom feeds, SVG images, the internal formats of Office documents (docx/xlsx), and Android layout files, to name a few.
This tool is the third in Toolbase's formatter lineup, following the JSON and SQL formatters — together they round out the three major data formats developers work with day to day.