Skip to main content

Convert XML to JSON online, attributes and all

XML
JSON

The result appears here as you type.

Uses the browser XML parser, so what you get back matches what the browser itself would read. Attributes are kept with an @ prefix so they never collide with a child element of the same name, and repeated elements collapse into arrays. Attributes are kept with an @ prefix so they never collide with a child element of the same name.

If it will not parse

These are the messages people usually arrive with: XML parsing error: not well-formed, unclosed token, mismatched tag, error on line 1 at column 1. Paste the input that produced one and the result pane names the problem and points at it.

How to use the XML to JSON Converter, step by step

Real screenshots of the tool, captured while running it.

  1. 1

    Open the tool

    XML to JSON Converter opens empty, with xml on the left and json on the right.

    Empty XML to JSON Converter before any input
  2. 2

    Add your input

    Paste your own xml, or load the sample. The json pane fills in as you type.

    XML to JSON Converter with input in place
  3. 3

    Read the result

    The json appears on the right with copy and save beside it.

    XML to JSON Converter showing its result

Questions people ask

Related tools