Attributes and text
<dependency scope="test">vitest</dependency> becomes {"#text": "vitest", "@scope": "test"}.
<dependency scope="test">vitest</dependency>
Paste XML. JSON is written beside it, or the parser error is shown.
Values stay strings. XML has no number or boolean type, so convert them in your code where you need to.
Ctrl+Enter or ⌘+Enter runs this tool immediately.
Waiting for input.
Parsing stays in this browser. Input is not uploaded or saved.
<dependency scope="test">vitest</dependency> becomes {"#text": "vitest", "@scope": "test"}.
<dependency scope="test">vitest</dependency>
Two <tag> elements become "tag": ["a", "b"].
<post><tag>a</tag><tag>b</tag></post>
Convert JSON to indented XML in the browser. Keys starting with @ become attributes, arrays become repeated elements, and special characters are escaped.
Validate JSON, then pretty-print it with 2 or 4 spaces or minify it. Invalid JSON produces an error and leaves the output empty.
Convert valid JSON into YAML with 2-space or 4-space indentation. Nested objects, arrays, and multiline strings are preserved, and invalid JSON is reported instead of repaired.