Docuboxer

XML Formatter

Format, indent and validate XML by pasting its contents.

100% local — your files are never uploaded to any serverNo signup · Free
Also in DataCFDI XML to PDFJSON FormatterConvert CSV to JSONXML Sitemap GeneratorUse it in the Suite with ⌘K and your history →

INPUT
Loading editor…
Calculating…
Everything is processed in your browser

How do you format and validate XML online?

Format XML and tidy up a messy document by simply pasting it: Docuboxer indents every tag at its level, checks that it is well-formed and, if you need it, minifies it back into a single line. Everything runs in your browser — the file is never uploaded to any server. It also converts XML to JSON, and JSON and CSV to XML with the root and row names you choose. It works for a SOAP response, an RSS feed, a sitemap or an e-invoice: you get the same document with readable hierarchical indentation, and the validator flags common breakers such as unclosed tags, badly nested elements or unquoted attributes. If the XML is a Mexican CFDI 3.3 or 4.0 invoice, you also get an invoice summary (issuer, recipient, date, total, number of line items and UUID) read locally; it only reads the data in the file and does not verify the seal or check the invoice with Mexico's SAT. Because processing happens in your device's memory, you can review XML containing financial or corporate data without it leaving your machine. It is not an installable app: you need a connection to open the page and load the tool.

How to use XML Formatter

  1. Paste your messy or minified XML into the tool's input panel.
  2. Got JSON or CSV instead of XML? Switch Mode to "JSON → XML" or "CSV → XML", paste your data and set the root name, the row name, whether values become attributes or elements, and the indentation; press Convert.
  3. The validator checks the structure while the formatter applies hierarchical indentation to every tag level. Use Minify to get the XML back on a single line.
  4. Review the result, fix any flagged errors, and copy the XML or download the file. For a CFDI, check the invoice summary below the editors.

Privacy

Real privacy: Your files are never sent to a server, so no copy exists on any server, log or backup. Your browser keeps only the usage history (tool, date, file name and size, if any, and a generic error notice if something fails), and you can clear it in Recents.

Common use cases

Validate and format XML config files

Check the structural correctness of web.config, pom.xml, AndroidManifest or any XML configuration before deploying it to production, avoiding startup failures.

Debug SOAP responses and legacy APIs

Tidy up XML responses from SOAP services and older systems that arrive as a single line, so you can inspect the structure, find the node you need and see why an integration fails.

Convert JSON or CSV for an XML-only system

An accounting importer, a SOAP service or a legacy system wants XML, and you have JSON from an API or a CSV exported from Excel. Convert it without uploading the data anywhere and review the result before sending it.

Process RSS feeds and XML sitemaps

Format and validate RSS/Atom feeds and XML sitemaps to make sure they meet the standard before submitting them to Google Search Console or content aggregators.

Review XML data exports

Accounting, payroll and government systems often export XML. Make it readable to audit the content before importing it into another system or handing it to a third party.

Read electronic invoices privately

E-invoicing formats are XML full of tax IDs and amounts. Format them to review line items without uploading fiscal data anywhere — it all stays in your browser.

Frequently asked questions

How do I read a Mexican CFDI invoice XML?

Open the .xml file in a text editor, copy its content and paste it into the input panel: the tool formats it and, if it is a CFDI 3.3 or 4.0, shows a summary below with issuer, recipient, CFDI use, date, document type, subtotal, total, currency, number of line items and UUID. The summary is built in your browser and does not verify the digital seal or the invoice status with Mexico's SAT; use the SAT's official verifier for that.

How do I format an XML file online?

Paste the XML into the input panel (or load the file) and the tool applies hierarchical indentation instantly: every nested tag sits at its level, readable at a glance. Everything is processed locally in your browser — no signup, no upload.

How do I convert JSON to XML?

Switch Mode to "JSON → XML", paste the JSON and press Convert. Every key becomes an element, arrays repeat the element named after their key, and everything is wrapped in the root you set (root by default). You can turn simple values into attributes, drop the <?xml?> declaration and pick the indentation. Keys starting with @ are written as attributes and #text as the element's content, the convention many XML-to-JSON converters use. Special characters (&, <, >, quotes) are escaped, so the XML is always well-formed.

How do I convert a CSV to XML?

Switch Mode to "CSV → XML" and paste the CSV (comma, semicolon, tab or pipe delimiters are detected automatically). Each row becomes an element (row by default) and each column a child element named after the header — or an attribute if you prefer. Invalid column names are fixed (spaces become underscores) and duplicates are numbered. Values are never converted: 00123 stays 00123. If your CSV has no header row, untick "First row is header" and the columns are named column1, column2…

What happens to null, empty arrays and numbers when converting JSON to XML?

XML has no types: numbers and booleans are written as text (30, true), and every number keeps the text you wrote: 1.50 stays 1.50, 1e3 stays 1e3, and a very large integer such as 12345678901234567890 keeps all its digits even beyond what a JavaScript number can hold (in current browsers; in an older browser numbers are normalized and a large integer may be rounded). null and an empty string produce an empty element (<field/>), and an empty array produces no element at all. If you need to tell null apart from an empty string, agree on a convention with whoever receives the XML. JSON can be nested up to 200 levels.

How do I fix an XML that arrives minified in one line?

Just format it: the tool rebuilds the tag hierarchy and presents it with consistent indentation, without changing the order of your data. “Sorting” has two meanings here. By default it means indenting. To really reorder, turn on “Sort attributes A–Z” or “Sort elements by name” (sibling elements, in a stable order); a level that mixes text or comments is left alone so nothing moves out of place.

How do I minify XML without breaking it?

Press Minify: indentation and line breaks between tags are removed and the result is still well-formed XML. CDATA sections, comments (unless you tick Remove comments) and the content of elements with xml:space="preserve" are kept exactly as they are. XML with errors is not minified: the tool points to the problem first.

What XML errors does the validator detect?

Unclosed tags, badly nested elements, unquoted attributes, unescaped characters, invalid XML declarations and encoding problems that break parsing. It points to where the problem is so you can fix it fast.

Does it support XML with namespaces and XSD schemas?

The formatter handles documents with namespaces (xmlns) correctly and indents them cleanly. Validation checks that the document is well-formed, but it does not validate against external XSD schemas.

What's the difference between valid and well-formed XML?

Well-formed means the syntax is correct: closed tags, coherent nesting, quoted attributes. Valid means it additionally conforms to a schema (XSD/DTD) that defines which elements are required. This tool guarantees the first — which is what breaks parsing in most real cases.

Is my XML uploaded to a server?

No. Formatting and validation run entirely in your browser's memory: no server, no logs, no retention. It is not an installable app: you need a connection to open the page and load the tool.

How do I convert XML to JSON?

Pick the “XML → JSON” mode, paste your XML, and copy the result. Attributes become keys that start with @, the text of an element that also has attributes or children goes in the #text key, and repeated elements are grouped into an array. It is the same convention “JSON → XML” uses, so you can go back and forth. XML has no types, so every value comes out as a string.