FlipMyFormat

XML to JSON Converter

Attributes, CDATA blocks and repeated elements handled properly, because the document is parsed rather than pattern-matched. Both directions.

Nothing is uploaded

XML

JSON

People Also Use

How to Convert XML to JSON

XML dominated data interchange for two decades and is still everywhere — RSS feeds, SOAP APIs, configuration files, government data, SVG. JSON replaced it for most new work because it is smaller and maps directly onto the data structures programming languages already have. Converting between them is routine, and the tricky parts are the two things XML can express that JSON cannot.

1

Paste or load your XML

Any well-formed XML works, including RSS feeds and SVG files. Drop a file if you prefer.

2

Choose how attributes appear

They need a prefix to avoid colliding with element names. The @ convention is the most common.

3

Copy the JSON

Or switch direction and go the other way, back to XML.

The Two Genuinely Hard Parts

Attributes have no JSON equivalent. XML lets an element carry both attributes and child elements, so <price currency="INR">1299</price> holds two separate pieces of information. JSON has only keys and values. The standard solution is a prefix — the attribute becomes @currency and the text becomes #text— which is what this tool does, with the prefix configurable to match whatever your codebase already uses.

Repeated elements are ambiguous. If a product has three tags, they naturally become a JSON array. If it has one tag, should that be an array with one item, or just a value? XML gives no way to tell, because there is no schema in the document itself saying "this element repeats". Most converters guess based on what they see, which means the same code path produces an object for one product and an array for another — a genuinely common source of bugs. The Always use arrays option removes the ambiguity: every child becomes an array, so your consuming code has one predictable shape to handle.

On parsing itself: this uses the browser's own XML parser rather than regular expressions. That matters because XML nests arbitrarily, attributes can contain angle brackets when escaped, and CDATA sections deliberately hold text that looks like markup. A regex approach handles the simple example in the documentation and breaks on the first real file.

Common Situations This Tool Solves

Consuming an RSS or Atom feed

Feeds are XML, but almost every modern application wants JSON. Converting once shows you the shape before you write any parsing code.

Working with a legacy SOAP API

SOAP responses are deeply nested XML. Seeing them as JSON makes the structure far easier to navigate and reason about.

Migrating configuration files

Older tooling used XML config; newer tooling wants JSON or YAML. This handles the first step of that migration.

Inspecting SVG structure

SVG is XML. Converting it to JSON is a surprisingly effective way to understand how a complex icon or illustration is built.

Frequently Asked Questions

How do I convert XML to JSON for free?

Paste your XML and the JSON appears immediately. Free, no signup, and nothing is uploaded.

Is my data uploaded to a server?

No. The XML is parsed and converted entirely inside your browser, which matters for API responses and config files.

How are attributes handled?

They get a prefix so they cannot collide with element names - @currency by default. You can change the prefix to match your codebase.

Why do single elements become objects instead of arrays?

XML gives no way to know whether an element repeats. Turn on Always use arrays for a predictable shape regardless.

Does it handle CDATA sections?

Yes. CDATA content is extracted as text, which is the point of it - the content deliberately looks like markup.

What about namespaces?

Namespaced element names are preserved as written, so soap:Body stays soap:Body rather than being silently stripped.

Why did my version number change?

Number detection converted it. Values only convert when the round trip is exact, but turn detection off if you want everything as strings.

Can I convert JSON back to XML?

Yes, switch the direction at the top. Keys with the attribute prefix become attributes again.

Does it work with RSS feeds?

Yes. RSS and Atom are both XML, and converting a feed is a quick way to see its structure.

What is the #text key?

When an element has both attributes and text content, the text needs somewhere to live. That key holds it.

Is there a file size limit?

Files above 5 MB are rejected because browser parsing becomes slow.

Is this XML converter really free?

Completely free, with no limits, no signup and no premium wall.

Last updated: July 24, 2026 · FlipMyFormat XML to JSON
Written and maintained by the FlipMyFormat team