XML to JSONの使い方
- 1
Paste or drop the XML
A .xml file, an RSS or Atom feed, a SOAP response or any XML text; the encoding in its declaration is respected.
- 2
Set the JSON shape
Attributes as @keys, plain keys or none; arrays only for repeated elements or everywhere; numbers typed or kept as text.
- 3
Copy the JSON
Pretty-printed or compact — copy it to the clipboard or download the .json file.
制限と Pro
XML files up to 100 MB, pasted XML of any size your browser can hold.
XML to JSON について
XML to JSON is for the moment an API, a government portal or an old integration hands you XML and your code wants JSON. The document's root element becomes the single top-level key, each child element becomes a property, and an element that occurs several times under one parent becomes an array, in document order.
Attributes need a decision because JSON has no such thing. The default writes them as keys starting with @ — <price currency="UZS">125000</price> becomes {"@currency": "UZS", "#text": 125000} — which keeps attributes and child elements apart and lets the JSON be turned back into the same XML. Plain keys give shorter objects; leaving attributes out suits documents that use them only for housekeeping.
Values: with type detection on, 42 and 3.5 become JSON numbers and true/false become booleans, but anything that would change if read as a number stays a string — postcodes and account numbers with leading zeros, numbers longer than 15 digits. Empty elements become empty strings.
Namespaces are kept as written (dc:title), or the prefixes can be dropped for cleaner keys, which also removes the xmlns declarations. "Always use arrays" gives every child element the same array shape, convenient when some records have one author and others have three.
Not carried over: comments, processing instructions and the DOCTYPE; text that is mixed with inline tags, as in XHTML paragraphs, is joined into a single string.
プライバシー
The XML is parsed in a background worker of this page with no network request; no DTD or external entity is fetched and the document never leaves your device.