XML is the backbone of many enterprise data formats — SOAP web services, SVG graphics, RSS/Atom feeds, Android resources, Office Open XML (docx/xlsx), and Maven/Gradle build files. This formatter validates well-formedness, pretty-prints for human readability, and minifies for wire transmission — all using the browser's native DOMParser for reliable, spec-compliant parsing.
Well-formed XML follows basic structural rules: exactly one root element, all elements properly nested and closed, attribute values always quoted, no illegal characters. Valid XML additionally conforms to a DTD (Document Type Definition) or XML Schema (XSD). This formatter checks well-formedness — it does not validate against a schema. Most data interchange scenarios require only well-formedness.
Common causes: unclosed tags (<item> without </item>); tags not properly nested (overlapping); more than one root element; missing quotes around attribute values; reserved characters (<, &) in text content without escaping; or an invalid XML declaration at the top.
HTML is a markup language for human-readable documents; browsers are lenient with malformed HTML. XML is strict — every violation causes a parse error. XHTML is a strict XML-conforming variant of HTML. SVG and MathML are XML vocabularies used inside HTML5 documents.
Use entity references: < for <, > for >, & for &. Inside a CDATA section (<![CDATA[...]]>), these characters can appear literally without escaping.
A URI that disambiguates element and attribute names from different vocabularies when combined in one document. The namespace is declared with xmlns="uri" or xmlns:prefix="uri". Used extensively in SOAP, SVG, and Office Open XML formats.
See also the XML Validator, XML to JSON, XML Minifier, and the JSON Formatter.