Text and writing
Check, format and save XML
Parse XML in your browser, check well-formed syntax and export XML with optional indentation.
Choose indentation only if whitespace between child elements may be rewritten. Without it, parsed whitespace is preserved. UTF-8 XML/JSON exports.
Result
Method:
No DTD/XSD validation, repair or HTML sanitization. XML parsing normalizes lines/attributes; serialization may change prefixes/entity spellings. Text-only preview; no network fetches or storage. Exported markup is not checked for safe execution.
Decimal results are approximate. Inputs stay in this browser tab.
Sources
How it works
Native XML parse, explicit bounded own whitespace traversal and UTF8 export; no schema or execution acceptance.
Worked example
Own sample items with text/attributes, optional element-only indentation.
About this calculation
The XML formatter parses XML in your browser, checks that it is well-formed and saves it again with or without indentation. It is useful for developers and editors who want readable configuration files, feeds or data exports.
Indentation is optional. Choose it only when whitespace between child elements may be rewritten; otherwise the whitespace found during parsing is kept. The result can be exported as UTF-8 XML or JSON. Parsing normalises line endings and attributes, and serialisation may change prefixes or entity spellings. The method follows XML 1.0 whitespace handling and the browser functions DOMParser and XMLSerializer.
There is no DTD or XSD validation, no repair and no HTML sanitisation. The preview shows text only, and exported markup is not checked for safe execution.
Frequently asked questions
How do I check whether XML is well-formed?
Paste the XML into the XML formatter. It parses the document in your browser and reports whether the syntax is well-formed before you export it.
How do I format or indent XML?
Choose the indentation option before exporting. Use it only if whitespace between child elements may be rewritten; without indentation the parsed whitespace is preserved.
Does the XML formatter validate against a DTD or XSD?
No. The XML formatter checks well-formed syntax only, without DTD or XSD validation, repair or HTML sanitisation.
Can the XML formatter change my markup?
Yes, slightly. XML parsing normalises line endings and attributes, and serialisation may change namespace prefixes or the spelling of entities.
In which formats can I save the XML?
The XML formatter exports UTF-8 XML and JSON. The exported markup is not checked for safe execution.
Does the XML formatter load external resources?
No. The preview is text only, and the tool makes no network fetches and stores nothing.