Last updated

How to Use

  1. Paste your XML code in the textarea
  2. Click "Format XML" to beautify with proper indentation
  3. Or click "Minify XML" to compress for production
  4. Click "Copy" to copy the formatted/minified XML
  5. Use in your API responses, config files, or documentation

Indentation Options

Common XML Use Cases

What is XML?

XML (eXtensible Markup Language) is a markup language for storing and transporting data. It's human-readable, machine-parsable, and widely used in web services, configuration files, and data exchange between systems.

Common XML Use Cases

Features

XML Formatting Examples

Before Formatting (Minified)

<root><user><name>John</name><age>30</age></user></root>

After Formatting (Beautified)

<root>
  <user>
    <name>John</name>
    <age>30</age>
  </user>
</root>

Examples

Example 1: Formatting Minified XML

API responses and generated XML files are often minified to reduce size. Paste them into the formatter to make them readable instantly.

Input (minified):
<catalog><book id="1"><title>Learning XML</title><author>Jane Smith</author><price currency="USD">39.99</price></book><book id="2"><title>XML in Practice</title><author>John Doe</author><price currency="USD">49.99</price></book></catalog>

Output (formatted, 2-space indent):
<catalog>
  <book id="1">
    <title>Learning XML</title>
    <author>Jane Smith</author>
    <price currency="USD">39.99</price>
  </book>
  <book id="2">
    <title>XML in Practice</title>
    <author>John Doe</author>
    <price currency="USD">49.99</price>
  </book>
</catalog>

Example 2: Formatting a SOAP Request

SOAP web service messages are often generated programmatically and arrive as a single line. The formatter makes them readable for debugging.

Input (minified SOAP):
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.example.com/webservice"><soapenv:Header/><soapenv:Body><web:GetUserRequest><web:UserId>12345</web:UserId></web:GetUserRequest></soapenv:Body></soapenv:Envelope>

Output (formatted):
<soapenv:Envelope
  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:web="http://www.example.com/webservice">
  <soapenv:Header/>
  <soapenv:Body>
    <web:GetUserRequest>
      <web:UserId>12345</web:UserId>
    </web:GetUserRequest>
  </soapenv:Body>
</soapenv:Envelope>

Example 3: Formatting a Maven pom.xml

Maven build files use XML. A well-formatted pom.xml is easier to review and maintain.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                             http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.example</groupId>
  <artifactId>my-app</artifactId>
  <version>1.0.0</version>
  <dependencies>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
      <version>3.2.0</version>
    </dependency>
  </dependencies>
</project>

Frequently Asked Questions

Yes, our Xml Formatter is completely free with no registration required. Use it unlimited times without any restrictions.

Yes, all processing happens locally in your browser. Your data never leaves your device and is not stored on our servers.

No installation needed. The tool works directly in your web browser on any device.

No, formatting only changes the visual presentation. Your actual data remains unchanged.

Yes, use the available options to adjust indentation, spacing, and other formatting preferences.