XML Editor

Edit XML in a code editor with folding and bracket matching, and watch a formatted, minified or normalised copy update on every keystroke.

Edit XML
Live result
Runs locally in your browser

About the XML Editor

Editing XML in a plain textarea means you find out about a mismatched tag when something else refuses to load it. Here the left pane is a full code editor with syntax colouring, foldable elements, search and replace, multiple cursors and undo history, and the document is re-parsed as you type. A well-formedness error is reported with its line and column before you copy anything out.

The right pane is a live rendering of whatever you have typed, in the form you pick. Formatted re-indents at the size you choose. Minified collapses the document to one line, optionally keeping comments. Attributes sorted puts every element's attributes in alphabetical order, which is the quickest way to make two hand-edited config files comparable. Comments removed drops standalone comment lines while leaving CDATA and processing instructions in place.

Upload pulls a file into the editor and Download saves the pane on the right, so the page doubles as a quick round trip for a POM file, an Android layout, a plist or an RSS feed. Nothing is sent anywhere, which matters for configuration that carries connection strings. When you only need indentation and nothing else, XML Pretty Print has more layout switches.

How to use

  1. Paste XML, upload a file, or start from the sample and edit it in place.
  2. Pick an output mode: formatted, minified, attributes sorted, or comments removed.
  3. Watch the right pane update as you type. Errors show the line and column of the problem.
  4. Copy or download the result when the document is well-formed.

Common questions

Can I fold large elements while editing?
Yes. Use the arrows in the editor gutter to collapse any element and its children.
Does sorting attributes change what the document means?
No. XML attribute order carries no meaning to a parser, so sorting is safe. It only matters if a downstream tool does its own text comparison.
Does the editor auto-close tags?
No. Auto-closing is left off so that pasted content is never modified behind your back.
Is my file stored after I close the tab?
No. The document lives only in the tab; download it if you want to keep the edits.