How do I convert JSON to XML or XML to JSON online?
Paste your JSON or XML, select the conversion direction, and click Convert. JSON objects become XML elements, arrays wrap items in configurable tags, and primitives become text content. XML attributes are preserved with a configurable prefix (default: '@'). Options include XML declaration, CDATA sections, root element name, and indentation. Download as .xml or .json. Everything runs in your browser — your data never leaves your device.
JSON ↔ XML Converter
Convert between JSON and XML formats. Handles nested objects, arrays, attributes, CDATA sections, and XML declarations.
About JSON ↔ XML Conversion
- JSON (JavaScript Object Notation) — lightweight data format with objects, arrays, strings, numbers, booleans, and null.
- XML (Extensible Markup Language) — hierarchical markup format with elements, attributes, namespaces, and CDATA sections.
- JSON → XML: Objects become elements, arrays wrap items in a configurable tag (default: "item"), primitives become text content. Root element name is configurable.
- XML → JSON: Elements become keys, repeated sibling elements become arrays, attributes use a configurable prefix (default: "@"), text content uses a configurable key (default: "#text").
- Swap button carries output to input for round-trip conversion.
- Everything runs in your browser — no data is sent over the network.
Frequently Asked Questions
How does JSON to XML conversion handle arrays?
How does XML to JSON conversion handle attributes?
Does the converter handle CDATA sections?
Can I do a round-trip conversion (JSON → XML → JSON)?
Related Convert Tools
CSS Unit Converter
Convert between px, rem, em, pt, vw, vh, and % — single values or batch-convert entire CSS files with configurable base font size
Base64 Codec
Encode and decode Base64 strings with Unicode support
Color Converter
Convert colors between HEX, RGB, and HSL formats
Epoch Converter
Convert Unix timestamps to dates and back