Transcode
Docs
Inputxml
Outputxml

XML Format

Format XML for readability or convert it to JSON.

Paste your input on the left and press Translate (or Ctrl/Cmd + Enter) to get the result on the right. Free, no sign-up.

Example

Input
<?xml version="1.0" encoding="UTF-8"?>
<library><book id="1" available="true"><title>Dune</title><author>Frank Herbert</author><year>1965</year></book><book id="2" available="false"><title>Neuromancer</title><author>William Gibson</author><year>1984</year></book></library>
Output
<?xml version="1" encoding="UTF-8"?>
<library>
    <book id="1" available>
        <title>Dune</title>
        <author>Frank Herbert</author>
        <year>1965</year>
    </book>
    <book id="2" available="false">
        <title>Neuromancer</title>
        <author>William Gibson</author>
        <year>1984</year>
    </book>
</library>

Frequently asked questions

How are XML attributes represented in JSON?
Attributes become properties prefixed with @_, which keeps them apart from child elements.
Can it fix invalid XML?
No. Malformed XML such as unclosed tags will return an error.