tools/convert/xml ↔ json
// convertnew

xml ↔ json

parse xml into json and back

drag & drop · up to 5 MB (Pro: 100 MB)
— paste xml to convert // client-only
// output appears here

              curl -sX POST 'https://api.whittly.dev/v1/xml/to-json' \
  -H 'Authorization: Bearer $WHITTLY_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"input":"<root><item id=\"1\">hello</item></root>"}'
            

              const res = await fetch('https://api.whittly.dev/v1/xml/to-json', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer ' + apiKey,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ input: "<root><item id=\"1\">hello</item></root>" }),
});
const data = await res.json();
            

              const { data } = await axios.post(
  'https://api.whittly.dev/v1/xml/to-json',
  { input: "<root><item id=\"1\">hello</item></root>" },
  { headers: { Authorization: 'Bearer ' + apiKey } }
);
            
// proschema validationpro·bulk conversionproupgrade →

// about this tool

XML and JSON are both widely used data serialization formats. XML is common in SOAP APIs, configuration files, and document formats; JSON dominates REST APIs and JavaScript ecosystems. This tool converts between them while handling attributes, namespaces, and arrays.

// when to use

  • Convert a SOAP API response to JSON for processing
  • Transform a config file from XML to JSON format
  • Convert RSS or Atom feeds to a JSON structure
  • Migrate data between systems using different formats

// faq

How are XML attributes handled?
XML attributes are converted to keys with an @ prefix in the JSON output (e.g. <tag id="1"> becomes {"tag": {"@id": "1"}}). This preserves all attribute information in the JSON representation.
What about XML namespaces?
Namespace prefixes are preserved as-is in key names. Full namespace URI resolution is not performed — the tool treats them as opaque prefixes.
// history
Pro Cloud Sync — upgrade
no operations yet