About online XML and JSON conversion
Switch between XML payloads and JSON when integrating legacy SOAP services, config files, or log snippets.
Direction is detected automatically from whether input starts with { or <.
Online XML ↔ JSON capabilities
Auto direction
JSON becomes indented XML with a root element; XML becomes nested JSON keyed by tag names.
Tags, attributes, and content
Element names become JSON keys. Attributes and text inside tags are kept in the JSON so structure is not lost when you inspect the result.
Limits
- No XML namespaces, CDATA sections, or mixed-content rules beyond simple text nodes.
- Arrays appear when the same tag repeats; single-child objects stay nested objects.
- Not a full data-binding schema—validate against your API contract after converting.
Common use cases
Legacy SOAP / XML APIs
Inspect a SOAP envelope as JSON in the debugger or write quick scripts against the tree.
Config & sitemap snippets
Pretty-print XML logs or turn a small config block into JSON for diff tools.
Mobile & plist-style XML
Convert simple property-list-like XML when only JSON tooling is available.
Frequently asked questions
- Why is my JSON not valid XML after conversion?
- JSON keys must become XML element names—spaces and special characters are sanitized to safe tag names. If keys are numeric-only, the tool may prefix them so the XML stays well-formed.
- Does XML → JSON preserve attributes?
- Yes—attributes on an element are kept in the JSON together with child tags and text, so you can see the full node, not just inner text.
- How are repeated XML tags handled?
- The first occurrence becomes a single value; duplicate sibling tag names become a JSON array of values under that key.
- Can I convert huge XML files?
- The browser must parse the whole paste in memory. For multi-megabyte files, use streaming CLI tools; this page suits messages, configs, and log excerpts.