JSON tool
JSON to XML — free online tool
Convert any JSON document to well-formed XML in your browser — proper entity escaping, nested elements, attributes via the `@` prefix.
What does this do?
XML is still ubiquitous in enterprise integrations, SOAP services, SVG, and many legacy APIs. This converter emits well-formed XML with a UTF-8 declaration, escapes the five XML entities (`<`, `>`, `&`, `"`, `\'`), validates element names, and supports the common JSON-to-XML conventions used by libraries like Newtonsoft.Json and xml2js.
When to use it
- ▸Adapt JSON API output for a SOAP/XML downstream system
- ▸Convert configuration to XML for tools that require it
- ▸Generate test XML fixtures from JSON examples
- ▸Quick-check what JSON would look like as XML
Tip
Object keys become element names. Arrays repeat the parent element. A key starting with `@` becomes an attribute on the parent element, and a key named `#text` becomes the text node — the same convention used by xml2js and most JSON↔XML libraries.
Example: Book record with attributes
Input — JSON
{
"book": {
"@id": "b-42",
"@lang": "en",
"title": "The Pragmatic Programmer",
"authors": [
{ "@role": "primary", "#text": "David Thomas" },
{ "@role": "co", "#text": "Andrew Hunt" }
],
"year": 1999
}
}Output
<?xml version="1.0" encoding="UTF-8"?> <book id="b-42" lang="en"> <title>The Pragmatic Programmer</title> <authors role="primary">David Thomas</authors> <authors role="co">Andrew Hunt</authors> <year>1999</year> </book>
More JSON tools
JSON to YAML
Convert any JSON document to YAML 1.2 in your browser — proper quoting, nested objects and arrays, multi-line strings.
JSON to CSV
Turn a JSON array of objects into a clean CSV file — perfect for Excel, Google Sheets, BigQuery, or any database import.
JSON Validator
Paste any JSON to instantly check if it's valid — get the exact error message, and one-click auto-repair for the common mistakes.
JSON Minifier
Shrink any JSON to the smallest valid form — strip every byte of whitespace, indentation, and line breaks while keeping the value identical.
Full JSON editor →
Pretty · Minify · Tree · YAML · XML · CSV · Schema · JSONPath · auto-repair
