JSONL ↔ XML Converter
100% client-side. No upload.
Convert
JSONL ↔ XML Converter
Turn a JSONL stream into a single XML document where each record becomes an element under a configurable root, or parse XML back into one JSON object per line. Useful for handing data to legacy SOAP / RSS / DocBook pipelines, or for ingesting XML feeds into JSON-first systems. 100% in-browser.
How it works
JSONL → XML wraps the whole file in a configurable root element (default
<records>). Each JSON object becomes an item element (default
<record>), with its keys as child elements. Nested objects become
nested elements; arrays become repeated elements with the same tag name.
XML → JSONL uses the browser's built-in DOMParser. Each child of the root
becomes one JSON object on its own line. Repeated child tags collapse into arrays
automatically. Attributes are emitted as @name keys; text content as
#text.
Tips & common pitfalls
- XML keys can't start with a digit. If your JSON has numeric keys, the converter prefixes them with
k. - Special characters are escaped.
<,>,&, and quotes inside values are XML-escaped automatically. - Arrays need a parent. A bare top-level JSON array doesn't fit naturally into XML — that's why we wrap the whole file in a root element.
Example
Input JSONL:
{"id":1,"name":"alice","tags":["a","b"]}
{"id":2,"name":"bob","tags":["c"]}
Output XML:
<?xml version="1.0" encoding="UTF-8"?>
<records>
<record>
<id>1</id>
<name>alice</name>
<tags>a</tags>
<tags>b</tags>
</record>
<record>
<id>2</id>
<name>bob</name>
<tags>c</tags>
</record>
</records>