XML to JSON converter

Paste XML or open an .xml file (an RSS feed, a SOAP response, a sitemap, a config file) and get JSON. Attributes become @id keys, repeated elements become arrays, entities and CDATA are decoded, and numbers can be typed while IDs like 0123456789 stay text. Nothing is uploaded.

Open a file: (or drop it on this box)

 

     

How XML maps to JSON

Each element becomes a key. Attributes become keys with a prefix (@id by default; set it to _ or - if your code expects that, or turn attributes off). An element that has both attributes and text gets its text under #text. An element that appears twice under the same parent becomes an array; one that appears once stays an object, so a feed with a single <item> gives an object where a feed with two gives an array: check for both in code that reads it. Namespace prefixes (dc:title) are kept unless you strip them.

Numbers and text

With "Detect numbers and true/false" on, 44.95 becomes a number and true a boolean, but values with leading zeros (0123456789, zip codes) and hex-looking strings stay text. Entities such as &amp; and CDATA sections are decoded into plain text. Invalid XML (an unclosed tag, a stray &) is reported with its line and column instead of producing half a result.

Render the result as a PDF or an image

Need the data as a document? The Shotmint API turns HTML into a PDF or PNG in real Chromium: POST https://shotmint.creasework.com/v1/pdf with {"html": "…"} returns a PDF, and /v1/screenshot returns a PNG of any page or HTML (1 credit each; 25 free renders a month, then €5 for 2,000 that never expire). Scripts, AI agents and Make or Zapier can get a key with a bare POST https://shotmint.creasework.com/v1/keys/free (no body, JSON reply); the request bodies are described in openapi.json.

Get 25 free renders a month API docs

FAQ

Is my file uploaded? No. Parsing and conversion run in your browser with js-yaml and fast-xml-parser; this page sends nothing to a server, so it works for secrets in config files.

Can it convert the other way? Yes: every page reads JSON, YAML and XML (detected automatically), and the "Convert to" menu picks the output, so it also converts XML to YAML or reformats a file in its own format. Related: JSON to YAML, YAML to JSON, JSON to XML, CSV to JSON, JSON to CSV, JSON to Excel.

Related tools

JSON to XML · XML formatter · Minify XML · XML Validator · YAML to JSON · JSON to YAML · CSV to JSON · JSON formatter · JSON to CSV · Excel to JSON Converter · JSON Diff · JSON to Excel Converter · JSON Validator · Minify JSON · all free tools