XML to JSON Converter (Both Ways)

Convert XML markup into JSON objects — or JSON back into XML

A two-way converter that parses hierarchical XML into nested JSON, and rebuilds JSON structures as valid XML tags. Attributes (@attributes) and text nodes (#text) are mapped carefully in both directions so nothing gets lost on the round trip.

도구를 불러오는 중…

🔒 Everything runs 100% in your browser. Your files and input are never uploaded to any server.

How to use

  1. Choose the XML to JSON or JSON to XML tab at the top.
  2. Enter the data you want to convert into the input box.
  3. Check the output along with any syntax warnings, such as unclosed tags, then copy the final result.

FAQ

How are XML attributes preserved in the JSON output?
Any element that carries attributes gets them mapped into a nested object under an '@attributes' key inside the JSON, so every value is kept intact.
What happens in the JSON output when the same tag name repeats multiple times?
When the same tag name appears more than once under the same parent, that key's value is automatically converted into a JSON array instead of a single object, with each occurrence added as an array element in order. Going the other way, JSON → XML, each element of an array is expanded back into a sibling tag with that same repeated name.
What happens in the JSON output when the same tag name repeats multiple times?
When the same tag name appears more than once under the same parent, that key's value is automatically converted into a JSON array instead of a single object, with each occurrence added as an array element in order. Going the other way, JSON → XML, each element of an array is expanded back into a sibling tag with that same repeated name.

← Back to all tools

See pricingFree chat consult