Paste XML to indent it or to strip the whitespace between tags. Attributes, comments, CDATA sections and the declaration come back unchanged, and tag errors are reported with line and column.
Runs locally in your browserThe formatter only adds or removes whitespace between tags; attribute values, comments, CDATA sections, the declaration, DOCTYPE and processing instructions are written back byte for byte. Compression keeps comments, and a subtree marked xml:space="preserve" is left alone by both buttons.
Indent pasted XML so it can be read, or strip the whitespace between tags to make the document compact. The layout is rebuilt from a single scan of the input: attributes, comments, CDATA sections, the XML declaration, DOCTYPE and processing instructions are written back unchanged.
The scan runs in this tab, so nothing is uploaded and the page keeps working with the network disconnected. Tag nesting is checked while the document is read; this is not a validation against a DTD or an XML Schema.
Indentation is the only thing it adds: four spaces per level, and an element whose content is text only stays on one line. Mixed content is never rearranged, so <p>Hello <b>world</b> !</p> keeps its spaces and comes back exactly as it was written.
Attribute values, comments, CDATA sections, the declaration, DOCTYPE and processing instructions are copied byte for byte, and attribute order is preserved. The one exception is an unquoted value such as class=x, which is written back as class="x" and reported, because XML requires the quotes.
Compression drops whitespace-only text between markup at every level, so an indented document becomes one compact line. Text content is not touched: <a> spaced text </a> and mixed content keep their spaces, and an element whose whole content is whitespace keeps it as well.
Comments survive compression; delete them yourself if the bytes matter. A subtree marked xml:space="preserve" is left untouched by both buttons.
Problems are reported by position, for example “Line 1, column 10: </b> closes <a> instead.”, “Line 1, column 7: <a> is never closed.” or “Line 1, column 1: </x> has no matching start tag.”. The layout is still printed so you can see what the tool made of the input, but the reported position is what to fix first.
If the input holds no element at all — plain text, or only whitespace — the tool says so instead of printing a guess. Only the first five problems are listed, with a count of the rest.
A 600 KB document with 20,000 elements is laid out in roughly 0.15 seconds in Chrome, and output longer than 200,000 characters is printed without syntax colouring so the tab stays responsive. The practical ceiling is the memory of your own device.
The check is structural only: the tool does not validate against a DTD or XML Schema, does not resolve entities or download external files, and does not report whether namespace prefixes are declared. Indent size is fixed at four spaces.