XML to JSON Converter

Convert XML documents to JSON and vice versa instantly. Supports attributes, namespaces, CDATA, and nested elements. Free, fast, and 100% client-side.

Drop file here or click to upload

Options
Quick Examples

About XML to JSON Converter

This free online tool converts XML documents to JSON format and vice versa. It handles XML attributes, text nodes, CDATA sections, nested elements, and namespaces. All processing happens entirely in your browser — no data is sent to any server. Perfect for API development, data migration, configuration management, and debugging.

Features

  • Bidirectional conversion: XML → JSON and JSON → XML
  • Supports XML attributes, text nodes, CDATA, and namespaces
  • Customizable attribute prefix and text node key names
  • File upload with drag-and-drop support
  • One-click copy and download as file
  • 100% client-side — your data never leaves your device

Frequently Asked Questions

Does this tool support XML namespaces?

Yes. Namespaces are preserved in element and attribute names (e.g., "ns:element" or "@ns:attribute").

How are XML attributes handled in JSON?

Attributes are converted to object properties with a configurable prefix (default "@"). For example, <user id="123"> becomes { "@id": "123" }.

Is my data private?

Absolutely. All conversion happens entirely within your browser. No XML or JSON data is transmitted to any server.

Can I convert large XML files?

Yes, within browser memory limits. For extremely large files (100MB+), consider using a command-line tool like xml2json or jq.