⇄LocalShift. Runs on your device
{ }

XML to JSON

Bring XML records into your JSON workflow.

On-device conversion
YOUR PRIVATE WORKSPACE
0 characters
Ready when you are
Conversion options

Loading converter…

Maximum input: 5 MB. Files are processed locally; large outputs are available as downloads with a shortened preview.

THREE SIMPLE STEPS

How to use XML to JSON

  1. Add your XML data. Paste text or select a file from your device.
  2. Choose your options. Review the settings and select Convert.
  3. Save your result. Preview, copy, or download the output.
GOOD TO KNOW

Know your output.

XML attributes use @_, text uses #text, and JSON exports are wrapped in a root element. Mixed-content XML and round trips may change structure. Standard character entities are decoded; DTD and entity declarations are not supported.

Conversion happens locally. Refreshing or closing this tab clears the workspace; downloaded files remain on your device.

WHAT THIS TOOL DOES

XML to JSON: conversion behavior

Convert XML elements and attributes into JSON locally. Attributes use @_ prefixes, text alongside attributes uses #text, and element text stays string data.

Use it to inspect simple XML records or feeds. Review repeated elements and mixed content before using the output.

ProcessingYour browser · no upload
Input → outputXML → JSON
Input limit5 MB
Cost & accountFree · no account
  • An id="001" attribute becomes an @_id property with a string value.
  • Repeated sibling elements can become arrays; a single occurrence may remain a single value. There is no fixed-array schema option.
  • Standard character entities such as & are decoded. DTD and entity declarations are rejected.
  • Mixed content, namespace semantics and exact whitespace are not guaranteed to survive a round trip.

Questions about XML to JSON

Why are numbers in quotes?

Element and attribute values stay strings so values such as 001 are not automatically rounded or stripped.

Can I convert XML with a DTD?

No. Use an input without DTD or entity declarations.