Browser tool
XML ⇄ JSON Converter
Move between XML and JSON with schema-aware conversion rules.
Convert XML documents into JSON or rebuild XML from JSON structures without leaving the browser. Inspect element and attribute counts, and share links that recreate both panes instantly.
Key points
Attribute-aware parsing
Client-side privacy
Parser & output options
Drop XML attributes during conversion and omit them from stats.
When disabled, numeric and boolean values stay as strings in JSON output.
Toggle between indented and minified JSON/XML output when converting.
XML input
EditableJSON output
EditableImport files
Drop XML or JSON files to populate the active input. Content stays on this device and never uploads to a server.
Populate the XML pane from a local document.
How to use this tool
Step 1
Choose your direction
Pick XML → JSON or JSON → XML based on the data you have. The active mode determines which pane is treated as the source.Step 2
Paste, drop, or edit
Paste structured data, drag in .xml/.json files, or tweak an existing share link. The tool updates the URL automatically for collaboration.Step 3
Convert and export
Run Convert for fresh output, Beautify to tidy formatting, then copy or download the result when it looks right.
Frequently asked questions
- How are XML attributes represented in JSON?
- Attributes use the @_-prefixed keys that fast-xml-parser emits by default (for example, <item id="1"> becomes {"item":{"@_id":1}}). This keeps attribute data separate from child elements.
- Will large numbers stay accurate?
- Yes. Values longer than 15 digits stay as strings to avoid precision loss. You can always convert them manually if you prefer numeric handling.
- Do comments or processing instructions survive?
- Comments and CDATA sections stay present in the XML output. When converting to JSON they appear on #comment or #cdata keys so you can decide how to handle them.
JSON output follows fast-xml-parser conventions using the @_ prefix for attributes and #text keys for raw node values. Review the mapping before feeding the data into other systems.