XML Flattener
Flatten XML elements and attributes into path/value rows, CSV or JSON. Preview the result, copy it or download a text file in your browser.
Start using
Read the flattened paths
The example produces @id = 7 and name = Ada, not user.name. Root attributes start with @. Repeated sibling names receive zero-based indexes, such as item[0] and item[1]; an attribute on the first item is item[0].@code. A root containing only text uses its own element name as the path.
Choose an output format
Key = value shows one path/value pair per line. CSV starts with path,value, quotes both fields and doubles embedded quotation marks. Its column delimiter stays a comma regardless of the path separator. JSON produces a flat object whose values are strings. Namespace prefixes remain in element and attribute names; namespace declarations may appear as attributes.
What is preserved and omitted?
Attributes and nonempty leaf text are included. Leaf text is trimmed; empty elements, comments and processing instructions do not become values. Text around child elements is omitted, so <p>before<b>inside</b>after</p> preserves the leaf value inside but not before or after. This is a structural export, not a reversible XML conversion.
Conflicts and supported input
If two different source nodes produce the same path, conversion stops instead of overwriting a value. Change the separator or source names and run again. Invalid XML, DTDs and custom entity declarations are rejected; the previous download is disabled. Legitimate elements named parsererror are allowed. The tool does not validate XML schemas or run XPath or XSLT.
Limits
Pasted input is limited to 16,777,216 UTF-16 code units, while a selected file has a separate 64 MiB byte limit. These are rejection thresholds, not performance guarantees. XML nesting may extend to 200 parent-child steps below the root, and output is limited to 100,000 attribute or leaf values. Start with a small sample for large or deeply nested documents. Parsing, flattening and export run in this browser; the selected file is not uploaded.
Quotes do not neutralise spreadsheet formulas.
Processing takes place locally in your browser.