Web & Developer Utilities100% Client-Side

XML Minifier for Feeds and Fixtures

Use the XML Minifier to make a small document or fragment easier to copy as a compact string. It removes comments and whitespace between tags while keeping ordinary text such as a title in place. The result works well for simple fixtures and examples. Some XML uses whitespace between elements as part of its content, so keep the original available if a parser, signature, or integration depends on exact bytes.

Input
97 chars•6 lines
Output

Reverse tool

XML Formatter

Indent compact XML with two or four spaces. Inspect nested elements, attributes, and self-closing tags in feeds, sitemaps, exports, and test fixtures.

Open XML Formatter

How to Use the XML Minifier Online

  1. 1Paste a copy of the source XML. Include the full element or sample payload you want to keep together.
  2. 2Look through the compact result and compare the element order and attributes with the original.
  3. 3Check any comments and gaps between tags that a consumer might expect. Preserve the source for uses that depend on those details.
  4. 4Copy the output to the fixture or example, then test it with the application that will read it if the structure or whitespace matters.

Input & Output Examples

The comment and indentation between tags are removed, while the item text stays intact.

Input Sample
<items>
  <!-- inventory -->
  <item>Tea</item>
</items>
Expected Output
<items><item>Tea</item></items>

The gap between elements disappears. The two spaces inside the title and the attribute on the empty element remain.

Input Sample
<record>
  <title>Weekly  notes</title>
  <flag enabled="yes"/>
</record>
Expected Output
<record><title>Weekly  notes</title><flag enabled="yes"/></record>

Practical Developer Workflows

  • Create a small XML request fixture for a test that compares string output or transmits a compact sample.
  • Copy a simple sitemap or feed fragment into a documentation field that benefits from fewer line breaks.
  • Compare an indented export with its compact form when checking how much whitespace appears between records.

Zero Server Uploads & Complete Privacy

Runs 100% in your browser; no data is uploaded to any server.

Notice a bug, calculation error, or outdated info?

Let us know directly so our engineering team can fix it.

Frequently Asked Questions

The tool targets whitespace between adjacent tags and trims the input at its outer edges. Ordinary spaces inside a text value are usually retained. A whitespace-only value between tags can disappear, so check documents that use blank text as meaningful data.

Explore Other Tools

12 suggested tools

View all tools