{ jsonzen }0 bytes uploaded

JSON ↔ XML

Convert JSON to XML and back. Runs in your browser.

<5ms🔒client-only
Inputpaste ⌘V
Paste JSON here…
Output
Auto-runs on paste⌘↩
Tip: press Ctrl + Enter to re-run, or paste a large JSON to auto-format.
// EXAMPLES
// HOW IT WORKS

JSON → XML uses fast-xml-parser's XMLBuilder with 2-space indentation. XML → JSON uses XMLParser and XMLValidator to ensure the input is well-formed before parsing. Both run client-side.

// FAQ

How are JSON attributes vs children handled?

By default, all JSON properties become child elements. To produce XML attributes, prefix keys with @ (a fast-xml-parser convention).

Can I convert XML with namespaces?

Yes. Namespace declarations come through as attributes on the relevant elements.

What about CDATA sections?

When parsing XML, CDATA content is preserved as text. When generating XML, special characters are escaped using standard entity encoding.