Prettify XML with clean formatting, custom indentation, and instant preview. Tidy up your XML right in the browser and export it with ease.
How to Use:
- Paste XML into the input box or use Choose File to import
.xml
,.txt
, or.html
files - Toggle Include declaration to keep or remove the
<?xml version="1.0"?>
line - Use Collapse empty tags to convert empty elements into self-closing ones
- Select Indent Style:
- Spaces: default setting using space characters
- Tabs: switch to tab-based indentation
- Set your Indent Size in the box (e.g., 2 or 4) to control how much spacing is used
- Turn on Maximize output to make the preview area larger
- Output updates live as you make changes
- Use Copy Output to copy the formatted XML
- Use Export to File to download the result as
.xml
- Click Clear All to reset input, output, and all settings
What Prettify XML can do:
Prettify XML takes your compact or messy XML and transforms it into beautifully structured markup. You can control whether it uses tabs or spaces, how wide the indent is, and whether it keeps the XML declaration. If you’ve got empty tags you want to collapse like into
Example:
Before:
<items><item><name>Apple</name></item><item><name>Banana</name></item></items>
After:
<?xml version="1.0"?>
<items>
<item>
<name>Apple</name>
</item>
<item>
<name>Banana</name>
</item>
</items>
Common Use Cases:
Prettify XML is perfect when you need to clean up compressed or single-line XML. It’s especially handy for developers reviewing feeds, QA teams validating outputs, or anyone who just wants to make XML human-readable again. The live formatting helps you instantly see structure and spot issues fast.
Useful Tools & Suggestions:
Once your XML is prettified, run Highlight XML Syntax to make everything pop visually especially helpful when scanning complex tags. And if you’re prepping for edits, Replace XML Keys works smoother on well-formatted code.