Format XML Text


XML Formatter is used to Format XML text, documents or files by indenting & syntax highlighting them. The objects are layed out in a tree like structure which can be easily expanded/collapsed. The desired indentation level can be selected from the settings.



Input: Paste XML text below



Settings


Output: Formatted XML


XML is a widely used language that was once the de facto standard for data interchange between applications. Since the advent of JSON, however, it has lost the advantage to the more simple nature of JSON. Nevertheless, XML is still used by applications and SOAP based web services. Read more at wikipedia
Indentation
This setting governs how the output is indented which is something that varies depending upon your text editor settings. You have choice between the following indentation levels:-
  • 2 Spaces
  • 3 Spaces
  • 4 Spaces
  • 1 Tab
The indented output is easier for humans to comprehend. This is the most important use of this tool as people paste the minified or unformatted XML and try to understand what's in it via indentation.
2 Spaces
<?xml version="1.0"?>
<people>
  <person id="007">
    <name>James Bond</name>
    <age>69</age>
  </person>
  <person id="100">
    <name>Sir Donald Bradman</name>
    <age>100</age>
  </person>
</people>
3 Spaces
<?xml version="1.0"?>
<people>
   <person id="007">
      <name>James Bond</name>
      <age>69</age>
   </person>
   <person id="100">
      <name>Sir Donald Bradman</name>
      <age>100</age>
   </person>
</people>
4 Spaces
<?xml version="1.0"?>
<people>
    <person id="007">
        <name>James Bond</name>
        <age>69</age>
    </person>
    <person id="100">
        <name>Sir Donald Bradman</name>
        <age>100</age>
    </person>
</people>
1 Tab
<?xml version="1.0"?>
<people>
	<person id="007">
		<name>James Bond</name>
		<age>69</age>
	</person>
	<person id="100">
		<name>Sir Donald Bradman</name>
		<age>100</age>
	</person>
</people>
Feedback