7 min read
2026-02-04
XML (eXtensible Markup Language) is a markup language designed for storing and transmitting structured data. Despite the rise in popularity of JSON, XML remains the standard in many industries.
Prologue: `<?xml version="1.0" encoding="UTF-8"?>`
Root element is required
Nested elements with opening and closing tags
Attributes for metadata
###Format rules
| Rule | Description |
|---|---|
| Indentation | 2 or 4 spaces per level |
| Attributes | On one line or each on their own |
| Empty elements | `<element/>` or `<element></element>` |
| Comments | On a separate line |
XML supports namespaces to prevent element name conflicts from different schemas.
Paste the XML code
Choose a formatting style
Get a structured result
Check the validity of the document
The tool supports XML, XHTML, SVG, SOAP and other XML dialects.
See also: HTML Formatter, JSON Formatter, YAML ↔ JSON