Code & Data
Convert JSON to XML
Paste JSON and get an XML document — declaration, indentation, escaped content, and element names sanitised so the result actually parses.
JSON keys become element names. Characters XML does not allow in a name become underscores.
Paste valid JSON above and the result appears here.
- Runs in your browser
- No account required
- Free to use
How it works
JSON keys are not always valid XML names
A JSON key can be anything, including “first name” or “2024”. XML names cannot contain spaces and cannot start with a digit. Rather than emit a document no parser will read, invalid characters become underscores and a leading digit gets a prefix.
Text is escaped, all five entities
Ampersands, angle brackets and quotes in your data are escaped. An unescaped ampersand is the single most common reason a generated XML file fails to parse.
A top-level array gets a wrapper
XML documents have exactly one root element. An array at the top level would produce several, so it is wrapped in a named root with each item as a child — which is the shape every XML-to-JSON mapping produces in reverse.
What it does
Configurable root element
Name the root to match whatever schema is going to read it.
Indented and declared
An XML declaration with the encoding, and two-space indentation, so the result is readable as well as valid.
Key sorting
Optional and recursive, for stable output in version control.
Your data never leaves the page
API responses, config files and exports are exactly the sort of thing that should not be pasted into someone else’s server. Parsing happens in your browser and what you paste is never transmitted — there is no code here that could send it anywhere, even by accident.
Practical advice
Getting a better result
- XML has no arrays. A JSON array becomes repeated elements of the same name, which is how XML has always expressed a list.
- If your keys contain spaces or start with digits, check the element names in the output — they have been changed to be legal.
- For a schema-specific format, treat this as a starting point rather than a finished document. Attributes in particular have no JSON equivalent to map from.
Questions
Things people ask
How are JSON arrays represented?
As repeated elements sharing the parent’s name — XML has no array type, and repetition is how it has always expressed a list. A top-level array is wrapped in a single root element so the document stays well-formed.
What happens to keys XML does not allow?
Characters that are not valid in an element name become underscores, and a name starting with a digit gets an underscore prefix. Without that, the output would look right and fail to parse.
Related tools
JSON Formatter
Format and minify JSON, with errors that name the line.
Runs entirely in your browser
Open toolJSON Validator
Check JSON and get the line, column and cause of any error.
Runs entirely in your browser
Open toolJSON Viewer
Explore JSON as a collapsible tree instead of scrolling it.
Runs entirely in your browser
Open toolJSON to CSV
Turn an array of objects into a spreadsheet-ready CSV.
Runs entirely in your browser
Open toolWho builds these
Free tools by day. Websites that earn their keep by trade.
KuConvert is built by KUDUY, a web design and development agency. From custom WordPress builds to SEO and e-commerce, everything they do is engineered to bring you more qualified traffic and turn it into revenue.
Web Design
Custom, conversion-focused web design that captivates visitors and turns them into paying customers. Mobile-first, fast, and built to rank.
Web Development
Custom WordPress websites built with clean code, blazing-fast performance (Core Web Vitals optimised), and enterprise-grade security.
E-Commerce
Online stores that convert visitors to customers with seamless shopping experiences.
SEO
Technical SEO, keyword research, on-page optimisation and local SEO strategies that drive qualified organic traffic.
Digital Marketing
Data-driven campaigns that deliver measurable ROI across every channel.
Branding
Memorable brand identities that stand out in any market and build lasting trust.
Website Help
One-on-one expert support for bug fixes, updates and ongoing maintenance — without a long-term retainer.
Fixed scope, no surprise invoices
Most sites ship in four to eight weeks with the scope and the price agreed up front.
SEO from day one
Search is designed into the build — structure, schema and Core Web Vitals — not retrofitted.
A team, not a ticket queue
A project manager, a designer and a developer you can actually reach.
Need your whole site to load this fast?
Images are usually the heaviest thing on a page and the easiest win. KUDUY works on site speed, image delivery and Core Web Vitals for teams who would rather not do it by hand.
This tool runs entirely in your browser. Your files are never uploaded.