Tools

Word CounterReadability CheckerKeyword DensityWriting Pattern IndicatorLong-Tail Keyword IdeasSERP Snippet PreviewMeta Tag GeneratorURL Slug GeneratorRobots.txt GeneratorCore Web Vitals CheckerImage CompressorHTML MinifierCSS MinifierJavaScript MinifierVideo & Image SpecsQR Code GeneratorMerge PDFSplit PDFRotate PDFDelete PDF PagesRearrange PDF PagesExtract PDF PagesCrop PDFJPG to PDFPNG to PDFPDF to JPGPDF to PNGResize ImageCrop ImageImage ConverterWebP to JPGHEIC to JPGProfile Photo MakerImage to Text (OCR)MOV to MP4MKV to MP4WebM to MP4AVI to MP4MP4 to MP3Extract Audio from VideoTrim VideoMute VideoVideo to GIFResize VideoCompress VideoM4A to MP3WAV to MP3OGG to MP3AAC to MP3Split CSVSplit ExcelCSV to ExcelExcel to CSVExcel to XMLXML to ExcelXML to CSVXML to JSONJSON to CSV
Data & File toolsFree, no sign-upRuns in your browser

XML to JSON

Convert XML into clean JSON. Repeated elements become arrays, attributes are kept with an @ prefix, and numbers can be typed automatically.

Or paste the content instead

How the conversion works

  • Elements become object keys; elements that repeat become arrays.
  • Attributes are kept with an @ prefix, e.g. "@id": 1.
  • Text next to attributes is stored under "#text".
  • Types: with conversion on, 42 becomes a number and true a boolean. Codes with leading zeros, like 007, stay as text.

How to use the XML to JSON

  1. Choose an XML file, or paste XML.
  2. Choose whether to keep attributes and convert types.
  3. Click Convert, then copy the JSON or download it.

Frequently asked questions

Is my file uploaded anywhere?

No. The file is read and converted by your own browser, so it never leaves your device. That makes it safe for customer lists, finances and other private data.

Why is a single element not an array?

An element that appears once becomes a plain value; it becomes an array only when it repeats. If your code always expects arrays, check for both cases.

Are namespaces supported?

Yes. Prefixed tags like media:content are kept as key names exactly as written.