Free, browser-based utilities for everyday developer workflows

XML to JSON Converter

Convert XML, SOAP envelopes, and namespaced payloads into clean JSON locally in your browser — with presets, XPath scope, namespace handling, and workflow handoffs.

  • Presets cover Simple, Safe default, Lossless-ish, SOAP Body, SOAP Fault, and namespace/array strategies.
  • Repeated sibling elements become JSON arrays; attributes appear under @ prefixes.
  • SOAP 1.1 / 1.2 envelopes are detected — convert the Body, operation payload, or Fault detail.
  • Sensitive values (JWTs, bearer tokens, API keys, passwords) are flagged and can be redacted before sharing.
  • Local-only: nothing is uploaded. Encrypted share links keep your raw XML out of analytics.
Recommended starting point — preserves attributes (@), text (#text), and namespace prefixes.

XML input

SOAP responses, vendor payloads, config XML, and feeds are all accepted. Parsing runs locally — nothing is uploaded.

JSON output

Output: JSON Output stats: -

Document summary

Root-
Namespace-
Elements-
Attributes-
Arrays-
These options override the preset for fine-grained control. Changing the preset above resets these fields.
Conversion caveats

XML and JSON have different data models. Attributes, namespaces, comments, processing instructions, mixed content, element order, and repeated elements require conversion conventions — there is no single canonical mapping.

  • Simple is best for clean business data; it drops attributes and namespaces.
  • Safe default preserves attributes and namespace prefixes — the recommended starting point.
  • Lossless-ish preserves attributes, comments, PIs, CDATA, and mixed-content order.
  • Array consistency may require force-array paths for API consumers.
  • Namespace stripping can cause key collisions; the Namespaces tab highlights this risk.
  • Type inference can change "00123" to 123 or "true" to true. Leading zeros, UUIDs, large IDs, and dates are preserved as strings even when inference is on.
  • XML-to-JSON conversion is not always reversible. If you need round-tripping, prefer Lossless-ish mode.
Notes
  • All XML parsing, namespace analysis, XPath evaluation, SOAP detection, redaction, and exports run locally in your browser. No uploads.
  • The Lossless-ish preset preserves comments, CDATA, processing instructions, and mixed-content order — best for fidelity.
  • If you only need to inspect or query XML (XPath, tree view, namespace report), use the XML / XPath / SOAP Inspector.

How to use the XML to JSON Converter

Turn XML and SOAP payloads into readable JSON locally so they fit the rest of your API debugging workflow — without leaking sensitive data to a third-party service.

When to use it

How it works

  1. Paste the XML or SOAP payload into the XML input.
  2. Pick a conversion preset: Simple, Safe default, Lossless-ish, SOAP Body, SOAP Fault, Strip namespaces, Preserve namespaces, or Force arrays.
  3. (Optional) Tweak attribute, text, CDATA, comment, namespace, array, or type-inference options.
  4. (Optional) Use an XPath expression to convert just a subset of the document.
  5. Copy or download the JSON, or hand it off to JSON Formatter, JSONPath Tester, Schema Inspector, JSON Schema Validator, JSON Diff, or JSON ⇄ CSV.

Tips & pitfalls

Frequently asked questions

Does this tool upload my XML?

No. All parsing, conversion, namespace analysis, XPath evaluation, SOAP detection, redaction, reporting, and exports run entirely in your browser. Nothing is sent to any server.

How are XML attributes converted to JSON?

By default, attributes are placed under @-prefixed keys (e.g. @id, @currency). You can change the prefix, nest attributes under a single key (e.g. _attributes), or omit them entirely with the Simple preset.

How are repeated XML elements converted to arrays?

Repeated sibling elements automatically become JSON arrays. Single-occurrence elements stay as objects unless you use Force arrays mode or add the element to Force-array paths.

How are XML namespaces handled?

Choose between preserving prefixes in JSON keys, stripping them, or recording namespace URIs as metadata. The Namespaces tab lists all prefixes and warns when stripping would cause key collisions.

Can I convert only the SOAP Body or Fault detail?

Yes. When a SOAP 1.1 or 1.2 envelope is detected, the SOAP Mode tab offers Envelope, Header, Body, operation payload, Fault, and Fault detail scopes.

What happens to CDATA, comments, and processing instructions?

By default CDATA is treated as text and comments/PIs are dropped. The Lossless-ish preset preserves them under #cdata, #comment, and #pi keys. Counts always appear in the conversion report.

Why is XML to JSON not always reversible?

XML and JSON have different data models. Attributes, mixed content, element order, comments, processing instructions, and namespaces have no native JSON equivalent. Even with Lossless-ish mode, full round-tripping is not guaranteed.

How do I preserve leading zeros in IDs?

Disable type inference, or keep Preserve leading zeros on (default). Values like 00123, long IDs that exceed JavaScript safe integer precision, UUIDs, and date-like strings stay as strings.

Can I send the result to other JSON tools?

Yes. The Next Steps tab and toolbar offer one-click handoffs to JSON Formatter, JSONPath Tester, Schema Inspector, JSON Schema Validator, JSON Diff, and JSON ⇄ CSV Converter.

Runs locally in your browser. No uploads.