Browser-based developer tools

XML Formatter and Validator

Beautify, validate, minify and convert XML with an xmllint-style checker while keeping work inside the browser.

Input

0 bytes

Result

Ready

XML Linter xmllint-style validation notes JSON Formatter Tree view and validation Regex Tester Pattern matching and groups JWT Decoder Inspect token claims Timestamp Converter Unix time and ISO dates

Reference notes

XML cleanup and xmllint-style validation

Integration-friendly output

Formatted XML is easier to review when working with ERP exports, SOAP responses, feeds, configuration files and vendor integration payloads.

Attributes preserved

The XML to JSON view keeps attributes under an explicit attribute object, so converted output remains predictable when XML nodes carry metadata.

Well-formed XML checks

The validator catches common xmllint-style issues such as missing closing tags, mismatched tag names, unescaped characters and multiple root elements.

Frequently asked

XML formatter questions

Can Formalint format XML in the browser?

Yes. The static Formalint XML tool parses and formats XML locally in the browser.

Can XML be converted to JSON?

Formalint maps attributes to @attributes, repeated elements to arrays, and text or CDATA to strings. Mixed-content order is not preserved; this is not a lossless XML round trip.

Does Formalint upload XML input?

The current static release does not upload XML input to a server.

Why does my XML fail to parse?

The most frequent issues are a missing closing tag, mismatched tag names, an unescaped ampersand or angle bracket inside text content, or more than one root element. XML requires exactly one root element per document.

Does it validate against an XSD schema?

This tool checks that the XML is well-formed per the XML specification. It does not validate against a custom XSD or DTD schema.

Check the XML to JSON mapping

Use this fixture with To JSON before relying on converted data in an integration:

<order id="42"><note><![CDATA[A & B]]></note><tag>new</tag><tag>paid</tag></order>
{"order":{"@attributes":{"id":"42"},"note":"A & B","tag":["new","paid"]}}
  • Attributes remain strings; numeric-looking values are not coerced.
  • CDATA contributes literal characters. Adjacent text is joined without invented separator spaces.
  • Repeated names become arrays. Names such as __proto__ remain ordinary JSON keys.
  • Text-only values retain surrounding spaces. Whitespace-only indentation around child elements is omitted.

For <p>Hello <b>world</b>!</p>, the result contains a b value and #text equal to "Hello !". Their original interleaving is lost. Comments and processing instructions are omitted, and namespace prefixes remain in names. Keep the original XML for signed documents, publishing content and round-trip conversion.

Follow the XML linting workflow to resolve parser errors first, then inspect the JSON in the developer workspace.

Check that the result belongs to your current XML

Editing the input clears the previous result immediately. A failed Format, Minify, Validate or To JSON action also clears it. Copy and Download become available after a successful action on the current input; a failed XML parse cannot export an older JSON result.

  • Convert <root/> to JSON: Download produces formatted.json.
  • Replace it with <root> and validate: parsing fails and the previous result is unavailable.
  • Restore <root/> and format: Download produces formatted.xml.

For malformed data, follow the XML parser error checklist. A successful parse establishes well-formedness, not compliance with a vendor's XSD.