Free tools, no sign-up — everything runs in your browser.
ToolHub 1000Free online tools

XML to JSON Converter

Convert XML into JSON using a small built-in parser.

Quick answer: enter your details below and click Convert to JSON — your result appears instantly, right here in your browser. Nothing you enter is uploaded or stored.
X
Developer

Enter your details below.

How to use

  1. Paste your XML into the box.
  2. Click Convert to JSON.
  3. Copy the JSON result.

About this tool

This tool parses XML with a small parser written for this page, without relying on a browser XML parser, so the same logic can run in plain JavaScript environments too. Elements become objects, repeated child elements become arrays, and text values are converted to numbers or booleans when they clearly look like one, otherwise they stay as text. Element attributes are not preserved, and comments and processing instructions are skipped. Mismatched tags are reported as an error instead of producing a partial result.

Frequently asked questions

Are attributes kept?

No. This small parser reads elements and text only, so attributes are skipped.

Why is age a number, not text?

Because text that looks exactly like a number is converted to a number, and true and false become booleans. Other text stays as a string.

Related tools

All tools · Read the guide: XML to JSON Converter