Code & Data

Format XML and check it is well formed

Paste XML to indent it. It is parsed properly first, so you also find out whether it is well formed — and if it is not, which line broke it.

or paste your own — nothing is uploaded.

Well-formedness is checked — tags must nest and close — but no DTD or schema is consulted. CDATA sections and attribute values containing angle brackets are handled correctly.

Formatted XML

Paste XML above and the result appears here.

  • Runs in your browser
  • No account required
  • Free to use

How it works

01

Parsed, not pattern-matched

`<a title="a>b">` and `<![CDATA[</x>]]>` both contain angle brackets that are not markup. A formatter built on regular expressions mangles both. This one tracks quotes and CDATA sections, so it always knows whether a bracket is a tag.

02

Well-formed, not valid

Tags must nest and close, entities must be legal, and there must be a root element. No DTD or schema is consulted — that is validity, a different question, and well-formedness is what a formatter actually needs to do its job.

03

Text-only elements stay on one line

`<title>Dune</title>` is not improved by being spread across three lines, and for elements where whitespace matters it is not even equivalent. Only elements with element children get broken open.

What it does

Errors with a line number

An unclosed tag, a mismatched closing tag or an unterminated comment is reported with the line it starts on.

CDATA preserved exactly

Contents are literal by definition, so they are copied through untouched — entities inside CDATA are not entities.

Declarations and comments kept

The XML declaration and processing instructions survive. Comments are kept by default and can be dropped.

Nothing is uploaded

Parsed in your browser and never uploaded — which matters for a feed, an export or a config file.

Practical advice

Getting a better result

  • If the error points at the end of the file, the real problem is usually an unclosed tag much earlier — that is where the parser ran out, not where the mistake is.
  • Formatting twice should produce identical output. If it does not, that is worth reporting.
  • XML is case-sensitive: `<Item>` and `<item>` are different elements, and a mismatch between them is a common cause of "never closed".

Questions

Things people ask

Does it validate against a schema?

No. It checks well-formedness — that the document is structurally legal XML — which is what formatting requires. Validating against a DTD, XSD or RelaxNG schema is a separate job and needs the schema.

Will it break my CDATA?

No. CDATA sections are recognised before anything else and copied through byte for byte, including any angle brackets and ampersands inside them.

Who builds these

Free tools by day. Websites that earn their keep by trade.

KuConvert is built by KUDUY, a web design and development agency. From custom WordPress builds to SEO and e-commerce, everything they do is engineered to bring you more qualified traffic and turn it into revenue.

  • Fixed scope, no surprise invoices

    Most sites ship in four to eight weeks with the scope and the price agreed up front.

  • SEO from day one

    Search is designed into the build — structure, schema and Core Web Vitals — not retrofitted.

  • A team, not a ticket queue

    A project manager, a designer and a developer you can actually reach.

Need your whole site to load this fast?

Images are usually the heaviest thing on a page and the easiest win. KUDUY works on site speed, image delivery and Core Web Vitals for teams who would rather not do it by hand.

This tool runs entirely in your browser. Your files are never uploaded.