Free Tool

XML to JSON Converter

An XML to JSON converter is a free tool that turns XML markup into clean JSON so API payloads, feeds, and legacy data are easier to inspect, copy, download, and use in developer tools.

Paste XML, choose how attributes and repeated elements should be represented, then copy formatted JSON without sending your data to a server.

Input

Paste XML

Options

Shape the JSON output

Output

Formatted JSON

Stats

Conversion summary

Root

-

Output size

0 B

Elements

0

Attributes

0

Text nodes

0

Max depth

0

Turn your AI coding sessions into something shareable

Code Card turns Claude Code, Codex, and OpenClaw sessions into a public profile with activity graphs, token breakdowns, badges, and shareable developer cards. Start with npx code-card.

Get Code Card

FAQ

XML to JSON questions

What is an XML to JSON converter?

An XML to JSON converter changes XML markup into a JSON object so API payloads, feeds, and legacy data are easier to inspect, copy, and use in JavaScript tools.

Does this XML converter upload my data?

No. The conversion runs in your browser with DOMParser, so pasted XML and generated JSON are not uploaded to Code Card.

How are XML attributes handled in JSON?

When attributes are enabled, the converter stores them in an @attributes object on the matching element so they stay separate from child elements and text values.

Can repeated XML elements become arrays?

Yes. Repeated child elements are automatically grouped into arrays, and you can force every child element to use array output when a strict schema needs it.

What happens if my XML is invalid?

The tool shows the parser error and keeps the output from changing until the XML is fixed, making it useful for debugging malformed payloads.