Home > Formatter > XML Formatter

XML Formatter

Upload using drag & drop is also supported.

Number of indent spaces:

Input XML

XML document description rules

An XML document basically consists of the following two points.

Since XML does not have a fixed tag name like HTML's div and p, element tags can be named freely.

  • XML declaration tag <?xml ?>
  • element tag (Only one can be placed in the root)

A tag must have a start tag and an end tag, and these two make up a set.

As mentioned above, the tag name can be freely decided, so there is no problem in terms of rules as long as the starting and ending tag names match.

(ex) <Anything>Name</Anything>

For tags that don't require a value, you can omit the closing tag by adding a slash.

(ex) <Anything />

A set of XML declaration tags consists of '<?' to '?>'. No need to write two tags.

Also, since only one element tag must be arranged in an XML tag, if you want to use multiple tags, you can do so by putting tags within tags.

(ex) <Content><Item>Ball</Item></Content>


All tags including the XML declaration tag can have attributes.

The writing method is as follows.

<Element attr="value"></Element>