Skip to main content
CuteJSON
↑↓ Navigate Enter Select Esc Close

JSON to XML Converter

Convert between JSON and XML without either document leaving your browser.

Back to all tools
Namespaces and custom mapping

These settings change how attributes, text and namespace prefixes cross between JSON and XML. The defaults match the mapping described above.

Keyboard shortcuts

These work wherever the matching action exists on this page.

Open the command palette
Ctrl/Cmd + K
Run the main action
Ctrl/Cmd + Enter
Format
Ctrl/Cmd + Shift + F
Minify
Ctrl/Cmd + Shift + M
Copy output
Ctrl/Cmd + Shift + C
Open file
Ctrl/Cmd + Shift + O
Download output
Ctrl/Cmd + S
Close this dialog
Esc
Open this dialog
F1 / ?

Local data

Everything below is stored only in this browser, on this device. None of it is ever sent anywhere, and closing this dialog is not required for that to stay true.

Unsaved drafts
Tools with remembered options

Recently opened files

    No files opened yet on this device.

    Share via link

    The content is packed into the part of the link after the # sign, which browsers never send to a server. Nothing here is uploaded to cutejson.com or anywhere else.

    Shares the first input on this page. On a tool with more than one, only that one is included.

    Nothing to share yet. Paste or type something first.

    JSON

    Load from a URL

    Fetches the URL directly from your browser and loads whatever text it returns into this pane.

    XML

    The result appears here.

    Runs entirely in your browser. Nothing you paste is uploaded, and you can confirm that in your browser Network tab.

    About this tool

    XML has no single mapping onto JSON, so this tool picks one and states it on the page instead of pretending there is a natural one. Writing, an object becomes an element per member and an array becomes repeated sibling elements under a root element whose name you choose, because JSON has nothing that names an object the way a root element does. A member name that is not a legal XML element name stops the conversion and is named. An attribute becomes a key prefixed with @ and text sitting next to child elements becomes a #text key, and neither @ nor # is a legal XML name character, so a JSON key can never collide with them. A null becomes an empty element, and so do an empty object, an empty array and an empty string, because XML has one shape for nothing and cannot tell them apart, so they all read back as null. Reading, every value is a string, because XML records no types and guessing them is how a postcode becomes a number. A repeated element name becomes an array. The reader handles comments, CDATA, entity references and a DOCTYPE, and reports anything else with its position. The attribute prefix, the text key and namespace handling are all configurable in Namespaces and custom mapping, for a document that uses a different convention.

    How to use

    1. Choose a direction, then paste your document into the left pane or load the sample.
    2. Press Convert. Writing, you can name the root element first.
    3. Copy the result or download it as a file.

    Keep reading

    How to convert JSON to XML with a stated mapping Read the guide