Code Robo
Virtual Service
Java Code Complience

XML Formatter With Sorting
       Talk to EasyAssistant

XMl is heaviliy used almost in all applications. Very frequently to debug an issue we take XML from log which is unformatted. Formatter is required to format the XML captured from log. Along with formatting, sometimes we need to sort the xml also alphabetically.

This Easycodeforall XML formater has the capbility of formating an XML and sorting it alphabetically after formatting. Its free and available online! It can sort both elements and attributes in the XML document. Sorting is optional and its done based on user input selection. This Xml formater format XML string with 4 space indentation by default. But you can choose different indentation. It does beautify and show the formatted XML with color. Elements are shown in Orange color and attributes are shown in blue color. Just need to provide the XML string content as input. No need to download the tool. It supports upto 10 MB XML
Click Here To Watch A Demo On It(

XML:(* Required): It is required.
Indentation : Mode : Sort the output after formatting in alphabetical order.
XML Examples:

All of the examples use the following sample XML code.
XML 1:

How It Works:
First it check its welformedness of the input XML document. If its a wellformed XML, it converts it into Java String. Then recreate the XML document from Java String with indentation. It does just formatting, does not re-position any element or attributes. If XML us not wedllformed it thorws exception.
Pre Conditions:
  1. XML needs to be well formed
Steps To Execute:
  1. Add XML content in the text area.
  2. Select Sort Output check box if you want sort the output alphabetically .
  3. Select text mode. Default text mode is Normalization .
  4. Select indentation level. Default indentation level is 2 space .
  5. Click on the Format XML button
Output: Output is the formatted xml content and it provide an optiom to view the xml to view the xml the browser
User Comments:
Hitesh Poddar(2022-04-01):
It's liked this feature of formatting Xml with sorting! Excellent!
easycodeforall: (2022-04-02)
Thanks you!

Pankaj Singh(2022-04-06):
It ' good to have sorting option with formatting but can you please make the sorting checkbox unchecked by default.
easycodeforall: (2022-04-09)
Thank you!
easycodeforall: (2022-04-09)
Made the sorting option unchecked by default. Thanks again for your feedback!

Ayushi Kedia(2022-04-10):
Best XML formatting free tool with sorting option!!!
easycodeforall: (2022-04-21)
Thank you so much for using easycode XML formatter!

I put in a big xml file (50 mb) and it doesn't work. The site keeps timing out when I try
easycodeforall: (2022-04-12)
Thanks CK for reporting the issue. We will chek it. Apperent this issue is because of the size of the file.

Doesn't work with special characters, should add an option for charsets
anonymous: (2022-04-21)
Thanks for using easycodeforall! We will try to add character set option in the UI.

Sunanda Roy(2022-06-22):
XML Sorting is very useful!
easycodeforall: (2022-04-21)
Thank you so much!

Do you have an api for formatting and sorting xml for java or nodejs
easycodeforall: (2022-04-21)
Thanks for using easycode xml formatter. We do not have any public API. But if you email ( )us your exact requirement, we may be able to help you.

Post Your Comment:
Name :
Email ( Optional) :
Comments / Suggestion (* Required) It is required: :