Skip to main content

Convert JSON to XML

Convert JSON to XML locally in your browser.

Tool workspace

Convert JSON to XML in your browser. Output uses a <root> element; arrays become repeating <item> children. Nothing you paste is uploaded.

How it works

Paste JSON—the XML result updates as you type.

Conversion runs entirely in your browser. Every document has a single root element named <root>. A JSON object becomes child elements under the current parent (property keys are sanitized into element names). A JSON array becomes repeating <item> children under the current parent—including when the JSON root itself is an array. Nested objects and arrays recurse with the same rules. Scalars become text content; null yields an empty element; empty objects and arrays yield empty containers (<root/> when that is the whole document).

Invalid characters in keys become underscores; empty keys or names that do not start with a letter or underscore use a field_ prefix (blank keys become field_N). Text is XML-escaped. Empty input clears the result—no error. Invalid JSON shows a clear parse error. Nothing you paste is uploaded.

Examples

  • {"name":"Alice","age":30} → <root><name>…</name><age>…</age></root>
  • [{"name":"Alice"},{"name":"Bob"}] → <root> with two <item> children
  • {"tags":["a","b"]} → nested <item> under <tags>
  • "hello" → <root>hello</root>

Privacy

Privacy: this tool processes JSON locally in your browser. We do not log or store what you paste. Login is not required.

FAQ

Is my JSON uploaded?

No. Conversion runs entirely in your browser. We do not log or store what you paste.

What is the root element?

Every document uses a single <root> element. Arrays under any parent (including the root) become repeating <item> children.

What if a property key is not a valid XML name?

Invalid characters become underscores. Keys that are empty or do not start with a letter or underscore are prefixed with field_. Blank keys become field_N using a 1-based sibling index.

Do I need an account?

No. All published tools work for guests without login.