Loading…
Loading…
Format, validate and minify XML with syntax highlighting
Run your projects on Claude Code?
We packaged the .claude config that runs this site — 26 specialist agents, 14 workflow skills, and 6 rule files from 31 real production incidents. From $9.
Get the Claude Code Production Pack — $29XML (eXtensible Markup Language), defined by the W3C XML 1.0 specification, remains the data format of choice for SOAP web services, RSS/Atom feeds, SVG graphics, Android layout files, Maven POM files, and countless enterprise integration protocols. Raw XML from APIs and log files is often minified or improperly indented, making it unreadable. Validating well-formedness — proper tag nesting, attribute quoting, and a single root element — before sending XML in an API request catches integration errors that would otherwise surface as cryptic HTTP 400 responses.
The formatter parses XML using the browser's DOMParser API with the "text/xml" MIME type. DOMParser implements the W3C DOM Level 3 Core specification and returns a Document object or a parseerror document if the input is not well-formed. Syntax errors from DOMParser include a message and the line number of the first invalid token.
Formatting serializes the parsed DOM back to a string using a recursive tree-walking function that applies indentation proportional to the element nesting depth. Text nodes with only whitespace are discarded during serialization to prevent double-indentation artifacts from pre-formatted input. Attribute values are preserved verbatim.
Minification serializes the DOM with no indentation and removes all non-significant whitespace between elements. Text content of mixed-content elements (elements that contain both text and child elements) is preserved. The output is a single-line string suitable for embedding in code or API payloads.
A backend developer debugging a SOAP integration pastes a minified request body to format it for inspection before comparing it against the WSDL spec.
A developer working with Android layouts formats an auto-generated XML file from a build tool to make it readable before editing.
A data engineer validates that an XML export from a legacy system is well-formed before importing it into a pipeline that would fail silently on malformed input.
A developer formats an RSS feed response to verify the channel and item elements conform to the expected structure for a feed reader integration.
Paste XML in the input panel
Click Format to beautify or Minify to compress
Validation errors are shown with line numbers
Copy the formatted output with one click
About the XML Formatter & Validator
Yes. The formatter validates XML structure and reports syntax errors with line numbers. It checks for well-formedness including proper tag nesting and attribute quoting.
Yes. The formatter is optimized for browser performance and handles typical XML files up to several megabytes without issues.
Well-formed XML follows the syntactic rules of the XML specification: properly nested tags, quoted attributes, and a single root element. Valid XML additionally conforms to a schema (DTD or XSD) that defines which elements and attributes are allowed. This tool checks well-formedness; schema validation requires a separate XSD validator.
Yes. CDATA sections (marked with <![CDATA[ ... ]]>) are treated as opaque character data and passed through unchanged during formatting. Their contents are not modified, indented, or validated as XML.
Yes. SOAP envelopes are standard XML documents. Paste the raw SOAP XML and format it to inspect the envelope structure, header blocks, and body payload. This is useful when debugging SOAP API integrations where the raw request body is logged as a single-line string.
No. Minification only removes whitespace between elements and collapses inline whitespace in text content. Namespace declarations (xmlns attributes) are part of element attribute syntax and are preserved verbatim in both format and minify modes.
Builder/critic agent prompts with brakes built in
Open →DeveloperFormat, validate & diff JSON — runs entirely in browser
Open →DeveloperTest regex live — railroad diagrams + plain English explained
Open →DeveloperOne color in, full design system out
Open →