Skip to content
Tezmy Tools

XML to JSON Converter

Turn XML into JSON in one step, right in your browser

Indent

Runs in your browser. Nothing is uploaded.

About the XML to JSON Converter

This tool converts XML to JSON in your browser. XML is a tag-based format where every value sits inside named opening and closing tags, with optional attributes, and it is common in older APIs, feeds, office documents and configuration files. JSON is a text format built from curly-brace objects, square-bracket lists, strings, numbers, true, false and null, and it is common in web APIs, app settings and browser code. When a file in the first format has to go into a program that wants the second, you can paste the text, read the JSON on the right, and copy or download it. Elements become keys, repeated elements become a list, attributes appear with an at-sign style prefix and text inside the tags becomes the value. Everything runs on your device, so the XML you paste is never sent to a server, which matters when the data is a customer list, a payroll export or private settings.

Updated October 2026

How to use the XML to JSON Converter

  1. 1Paste your XML into the box on the left, or press Try a sample to see how it works.
  2. 2Check the options above the boxes; they only show the ones that matter for XML to JSON.
  3. 3Read the JSON output on the right. It updates as you type.
  4. 4If an error appears, it names the line of the XML that could not be read; fix it and the output returns.
  5. 5Press Copy result, or Download to save a JSON file.

Why people convert XML to JSON

The two formats suit different jobs. XML is a tag-based format where every value sits inside named opening and closing tags, with optional attributes; people meet it in older APIs, feeds, office documents and configuration files. JSON is a text format built from curly-brace objects, square-bracket lists, strings, numbers, true, false and null; people meet it in web APIs, app settings and browser code. A move from XML to JSON usually happens when data created in one place has to be used in another, and retyping it by hand would be slow and error-prone.

Elements become keys, repeated elements become a list, attributes appear with an at-sign style prefix and text inside the tags becomes the value. With the number option on, text such as 30 is turned into a number so that the JSON is easier to use in code.

    How the XML to JSON conversion works

    The tool first reads your XML into a plain structure of rows or objects, so it knows what is a key and what is a value. It then writes that structure again in the JSON style. Because nothing is guessed about the content, the values you see in the JSON are the ones that were in the XML.

    A single child element stays an object, while two or more with the same name become an array.

    • Paste the XML exactly as it is, including the header line if there is one.
    • Use Try a sample to see how a small XML turns into JSON before using your own data.
    • Read the JSON before you use it; check that special characters came through as you expect.

    Tips for a clean JSON result

    Start with tidy XML: the same keys or columns in every record give the neatest JSON. If your XML has stray blank lines or an inconsistent number of items, tidy them first, or the JSON will show empty values where something is missing.

    Keep a copy of the original XML. The conversion works well for data, but formatting such as colours, formulas and comments belongs to the program that made the file and does not travel into plain JSON.

      On phone and computer

      On a computer, paste with Ctrl+V or Cmd+V, check the JSON and use Copy result. On a phone, long-press in the left box to paste, and use the Download button to save a JSON file you can send from the share menu.

      The two boxes sit side by side on a wide screen and one above the other on a narrow one, so you can read both without zooming. Wide tables with many columns are easier to check on a computer, but short lists work fine on a phone. Once you have JSON, JSON Formatter makes it readable and JSON Validator checks it is valid. XML Formatter tidies the source file first, and Data Format Converter covers other pairs.

        Features

        • Converts XML to JSON as you type
        • Clear error messages that name the problem in the XML
        • Sample data to try first
        • Copy result or download as a file
        • Private: runs in your browser, nothing uploaded
        • Works on phone and computer

        Frequently asked questions

        How do I convert XML to JSON?

        Paste the XML into the left box and the JSON appears on the right straight away. Press Copy result to copy it or Download to save a file. You can also press Try a sample first. With the sample XML shown here, the JSON output is: { / "people": { / "person": [ / { / "name": "Ann", / "age": 30, / "@_id": 1 / }, / { / "name": "Bob", / "age": 25, / "@_id": 2 / } / ] / } / }.

        Is this XML to JSON converter free and private?

        Yes. It is free, needs no account and works in your browser, so the XML you paste stays on your device. Nothing is uploaded or stored, which makes it suitable for lists and settings that you would rather not send anywhere.

        What happens to numbers and true or false values when converting XML to JSON?

        With the option on, values that look like numbers or true and false are written as real numbers and booleans in the JSON. Turn the option off if you need every value kept as text, for example postcodes or phone numbers with a leading zero.

        What is the difference between XML and JSON?

        XML is a tag-based format where every value sits inside named opening and closing tags, with optional attributes. JSON is a text format built from curly-brace objects, square-bracket lists, strings, numbers, true, false and null. XML is mostly used for older APIs, feeds, office documents and configuration files, while JSON is mostly used for web APIs, app settings and browser code.

        What if my XML is invalid?

        The converter does not guess. It stops and shows what is wrong, with the line where it can tell, so you can fix the XML and try again. An empty box simply gives an empty result.

        Is there a size limit for XML to JSON conversion?

        Very large pasted text can slow a phone, so there is a limit of about 2 million characters. For the usual files, such as a few thousand rows, the JSON appears within a moment.

        Can I change the XML to JSON output after converting?

        Yes. The result is plain text that you can copy into any editor. If you change an option, such as the header row or the indent, the JSON updates by itself.

        Related tools