Skip to content

Invoice XML Formatter

Format or minify invoice XML — UBL and CII included — with comments kept.

Or drop an .xml file here

Quick Tool Overview

The Invoice XML Formatter pretty-prints or minifies invoice XML including UBL and CII, keeping comments, CDATA and the declaration, and never touching whitespace inside a text value, where it can be significant.

What it does
Formats and minifies invoice XML
You give it
UBL, CII or any invoice XML
You get back
Readable XML, or one line
Best for
Reading and diffing e-invoices
Invoice Tools Free, unlimited use No sign-up Runs in your browser

About the Invoice XML Formatter

A UBL invoice from an access point arrives as one enormous line. Nobody can read it, a diff against the version you sent is useless, and pasting it into a support ticket is unkind.

Paste it and this reformats it: one element per line, indented by nesting depth, with attributes left on their element and text kept inline where it is short. Comments, CDATA sections and the XML declaration are all preserved — a formatter that silently drops comments will eventually drop one that mattered.

Minifying goes the other way for a request body, and because the file is parsed rather than pattern-matched, a syntax error is reported with its line, column and cause. Whitespace inside an element’s text is never touched, because in XML that whitespace can be significant.

Key features of the Invoice XML Formatter

Comments kept

Along with CDATA and the declaration.

Text left alone

Whitespace inside values is significant.

Namespaces untouched

Prefixes stay as written.

Errors located

Line, column and cause.

Private

Formatted in your browser.

How to use the Invoice XML Formatter

  1. 1

    Paste the XML

    UBL, CII, or any invoice XML.

  2. 2

    Choose indent or minify

    Two spaces, four, tabs, or one line.

  3. 3

    Fix any syntax error

    Located to the line and column.

  4. 4

    Copy or download

    Formatted, as UTF-8.

Frequently asked questions

Whitespace between elements is not significant in UBL or CII, so no. Whitespace inside a text value is left exactly as it was.

Reviews of the Invoice XML Formatter

What people who use the Invoice XML Formatter think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the Invoice XML Formatter. It takes half a minute and no account.

Write the first review

More invoice tools