Skip to content
Developer & CodeLocal · Stays on device

XML Formatter

Pretty-print or minify XML while keeping comments, CDATA and declarations intact, with exact line and column validation errors.

Launch XML Formatter
  • XML
  • Free to use
  • No sign-up or watermark
xml-formatterOn this device
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10

About this tool

The XML is validated first; if it isn’t well-formed you get the line, column and reason (for example a mismatched closing tag). Valid XML is re-indented with 2 spaces, 4 spaces or tabs, keeping the XML declaration, DOCTYPE, comments, CDATA sections, processing instructions and attribute quoting exactly as written. Elements containing only text stay on one line, and elements marked xml:space="preserve" are copied verbatim.

Minify mode removes indentation and whitespace-only text between tags, and can optionally strip comments. Entities are never expanded and external entities are never fetched, so formatting untrusted XML is safe. Everything runs in your browser. Your data is never uploaded, logged or stored.

  1. Input

    Your code or text

    XML

  2. Processing

    Processed in this browser

    Instant, in-browser. Nothing is uploaded.

  3. Output

    Your result

    Ready to download or copy

Local processing pipelinefast-xml-parser (validator) + Custom tokenizer/formatter

How to use it

  1. 1

    Paste your XML.

  2. 2

    Choose Format (and the indentation) or Minify.

  3. 3

    Fix any reported error, then copy or download the result.

Zero-upload architecture

How to use XML Formatter for free, with no upload

Free, with no sign-up or watermark · Your files stay on your device

  1. 1

    Open XML Formatter

    Launch the app and add your file. There is nothing to install and no account to create.

  2. 2

    Work through it

    Choose Format (and the indentation) or Minify.

  3. 3

    Get your result

    Fix any reported error, then copy or download the result.

  • Local

    XML to JSON Converter

    Convert XML documents to JSON with control over attributes, text keys, arrays and value parsing.

    Open tool
  • Local

    HTML Formatter

    Beautify HTML with configurable indentation, line wrapping and attribute layout, without ever rendering or running it.

    Open tool
  • Local

    JSON Formatter

    Pretty-print, beautify and validate JSON with precise error locations, key sorting and custom indentation.

    Open tool
  • Local

    JSON Studio

    Edit, validate, format and explore JSON with a code editor, tree view and table view, then convert it to CSV, YAML or TypeScript.

    Open tool