Data tools

XML Formatter

Format your document locally. Tool input is processed locally, without uploading it.

Runs locally
Input: up to 1 MB. Output: up to 2 MB. Files stay in your browser.
Guide

Format XML (Extensible Markup Language) to make nested elements easier to follow. The formatter checks the structure and indents the result. External resources are never loaded.

  1. Add your document

    Paste into Input, choose an example or use Open file. You can also drop one UTF-8 file into Input.

  2. Choose the format

    Choose 2 spaces, 4 spaces or Tab for indentation.

  3. Read and keep the result

    Output updates automatically. Use the main button to run it again, then Copy output or Download to keep the result.

On mobile, choose Output to read the result. Clear removes both fields.

Indent

  • 2 spaces: use two spaces for each indentation level.
  • 4 spaces: use four spaces for each indentation level.
  • Tab: use a tab character for each indentation level.
Shortcuts
  • Ctrl / Cmd + Enter — Run selected action
  • Ctrl / Cmd + Shift + C — Copy output
  • Ctrl / Cmd + S — Download output
  • ? — Show shortcuts outside text fields

Shortcuts work while focus is in the workspace. Copy and download need valid output.

Common questions
Is my document uploaded?
No. Processing happens in a browser worker. Documents and filenames are not stored or sent to a server.
Which documents are supported?
XML text, attributes, comments, CDATA and namespaces are preserved. Mixed content and xml:space sections stay intact. DTD and entity declarations are rejected. XML nesting is limited to 100 levels.
What are the limits?
Up to 1 MB of UTF-8 input and 2 MB of output. Processing stops after five seconds; Cancel stops an active operation. Try a smaller document if a limit is reached.

Was this tool helpful?

Only your rating and optional feedback are sent. Your tool input and output are never included.