[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"i-lucide:file-text":3,"i-lucide:image":8,"i-lucide:code-xml":10,"i-lucide:search":12,"i-lucide:menu":14,"i-lucide:globe":16,"i-lucide:chevron-down":18,"i-lucide:check":20,"page-content:en:tool:xml-to-json":22,"i-lucide:lock":69,"i-lucide:arrow-up-right":71,"i-lucide:download":73},{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":7},0,24,false,"\u003Cg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\">\u003Cpath d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"\u002F>\u003Cpath d=\"M14 2v5a1 1 0 0 0 1 1h5M10 9H8m8 4H8m8 4H8\"\u002F>\u003C\u002Fg>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":9},"\u003Cg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\">\u003Crect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" ry=\"2\"\u002F>\u003Ccircle cx=\"9\" cy=\"9\" r=\"2\"\u002F>\u003Cpath d=\"m21 15l-3.086-3.086a2 2 0 0 0-2.828 0L6 21\"\u002F>\u003C\u002Fg>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":11},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"m18 16l4-4l-4-4M6 8l-4 4l4 4m8.5-12l-5 16\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":13},"\u003Cg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\">\u003Cpath d=\"m21 21l-4.34-4.34\"\u002F>\u003Ccircle cx=\"11\" cy=\"11\" r=\"8\"\u002F>\u003C\u002Fg>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":15},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M4 5h16M4 12h16M4 19h16\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":17},"\u003Cg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\">\u003Ccircle cx=\"12\" cy=\"12\" r=\"10\"\u002F>\u003Cpath d=\"M12 2a14.5 14.5 0 0 0 0 20a14.5 14.5 0 0 0 0-20M2 12h20\"\u002F>\u003C\u002Fg>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":19},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"m6 9l6 6l6-6\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":21},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M20 6L9 17l-5-5\"\u002F>",{"tool":23,"category":68},{"title":24,"description":25,"heading":26,"intro":27,"howTo":28,"sections":40,"faq":55},"XML to JSON Converter — Attributes and Repeated Elements","Convert XML to JSON in your browser. Repeated elements become arrays, attributes go under @attributes and text is kept as strings. Also converts JSON back to XML.","XML to JSON Converter","Paste an XML document and get readable JSON. Keep or drop attributes, and switch the mode to convert JSON back to XML.",{"title":29,"steps":30},"How to convert XML to JSON",[31,34,37],{"title":32,"body":33},"Paste your XML","A complete document with a single root element.",{"title":35,"body":36},"Choose attributes","Keep attributes is on by default. Turn it off to convert only elements and text.",{"title":38,"body":39},"Convert and copy","Copy the JSON or download it.",[41,50],{"title":42,"list":43},"How XML is mapped to JSON",[44,45,46,47,48,49],"The root element becomes the single top-level key.","An element that contains only text becomes a string; an empty element becomes an empty string.","Sibling elements with the same name become an array. A name that appears once stays a single value.","Attributes are collected in an \"@attributes\" object.","Text next to child elements is stored under \"#text\". The order of text and child elements relative to each other is not preserved.","Namespace prefixes such as soap:Envelope are kept in the names. Comments and processing instructions are left out.",{"title":51,"paragraphs":52},"Limits and safety",[53,54],"The XML is parsed by your browser's own XML parser. Documents with a DOCTYPE or entity declarations are refused, which also rules out entity-expansion attacks. Very large documents, over 8 MiB of text or more than 256 levels deep, are refused rather than freezing the page.","All values stay strings: the converter does not guess whether 007 is a number.",[56,59,62,65],{"question":57,"answer":58},"How are repeated XML elements converted?","Elements with the same name under one parent become a JSON array. If an element appears only once, it is a single value, so check for both shapes when you process the JSON.",{"question":60,"answer":61},"What happens to XML attributes?","With Keep attributes on, they appear in an \"@attributes\" object on the element. Turn it off to leave them out.",{"question":63,"answer":64},"Can I convert JSON to XML?","Yes. Switch Mode to JSON to XML. The JSON needs one root key, and \"@attributes\" and \"#text\" are turned back into attributes and text.",{"question":66,"answer":67},"Why is my XML rejected?","Common causes are unclosed tags, more than one root element, or a DOCTYPE declaration, which is not supported.",null,{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":70},"\u003Cg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\">\u003Crect width=\"18\" height=\"11\" x=\"3\" y=\"11\" rx=\"2\" ry=\"2\"\u002F>\u003Cpath d=\"M7 11V7a5 5 0 0 1 10 0v4\"\u002F>\u003C\u002Fg>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":72},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M7 7h10v10M7 17L17 7\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":74},"\u003Cg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\">\u003Cpath d=\"M12 15V3m9 12v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"\u002F>\u003Cpath d=\"m7 10l5 5l5-5\"\u002F>\u003C\u002Fg>"]