XML Editor screenshot

XML Editor

Edit XML as a tree: rename elements, add and remove attributes, move and delete nodes, and see the document written back as you go.

Privacy First
0 Runs
Updated 2026-11-07
Runs in your browser
No upload
No account needed
Nothing is stored

Reindenting text is a formatter; this is an editor. The things people actually change in markup are structural — rename an element, add an attribute, move a block, delete a node — and doing them as text edits is how a document ends up with two closing tags. So the source is parsed once into nodes, the panel edits nodes, and the document on the right is the tree written back. Bytes that are already an entity (&) are left alone, so editing a document does not double-escape it. Everything happens in your browser.

Paste XML and the page parses it into a tree you can edit: rename an element, change an attribute, rewrite text, add or delete a node, move a node up or down, and collapse a branch to see the shape of a large document.

The right panel is the serialized document, updated as you edit, written with two-space indentation. Copy takes that text, so the editor is a way to make a structural change without hand-editing matching tags.

It is an editor, not a validator. It checks that the markup parses, and it reports the position when it does not, but it does not check a schema, a DTD, namespace rules or whether the element names belong to your vocabulary.

The operations

Selecting a node shows its type. An element exposes its tag and its attributes, each editable, with a button to add or remove one; a text node exposes its text. Both offer add element, add text, move up, move down and delete.

The keyboard works on the outline: arrow keys move the selection, left and right collapse and expand, shift with up and down moves the selected node, backspace deletes, and the usual undo shortcut steps back through the history the page keeps.

  • Edit tags, attributes and text
  • Add, move and delete nodes
  • Undo and redo within the session

What serialization decides

The writer chooses the indentation; it does not preserve the whitespace of the input. A document whose meaning depends on significant whitespace between elements can therefore change when it is re-serialized, which is worth knowing before using the output as a diff.

Entities and comments are handled as the reader sees them; the page does not claim to round-trip every construct. A parse error is shown with its position and the tree is left at the last good state rather than partially rebuilt.

How to use the tree

Paste the XML into the input and select a node in the outline: an element exposes its tag and attributes for editing, a text node exposes its text, and both offer add, move and delete controls. The right panel re-serializes with two-space indentation as each edit lands.

Move with the arrow keys, collapse a branch to see the shape of a large document, and step back with undo when an edit goes wrong. Copy the serialised panel once the structure is right; a parse error leaves the tree at its last good state instead.

What to Expect

Best for

  • Renaming an element across a pasted document
  • Fixing a nesting mistake without matching tags by hand
  • Exploring the structure of an unfamiliar XML file

Not ideal for

  • Schema or DTD validation
  • A document whose whitespace is significant
  • Editing a file larger than the textarea can comfortably hold

What this tool keeps

  • The element names and attribute values you did not change
  • The order of children, unless you moved them
  • A parse error with its position when the input is malformed

What may need cleanup

  • Insignificant whitespace, which the writer normalises
  • Comments and processing instructions, which may not round-trip
  • The indentation, which is the writer's choice rather than the input's

Common errors

  • Pasting malformed XML and expecting a partial tree
  • Assuming the output is schema-valid because it parses
  • Comparing the output byte-for-byte with an input that had different indentation

Example use cases

  • Repairing a hand-edited configuration file
  • Renaming a tag in a small document
  • Learning the shape of an XML response

Sample input

A small catalogue document with one book element, a title and a price carrying a currency attribute.

Sample output

The same document serialized with two-space indentation, ready to copy, after any tree edit you made.

Who this is for

  • Developers editing configuration
  • Analysts inspecting an XML response
  • Students learning element structure

Frequently asked questions

What can the XML editor change?

Rename an element, change an attribute, rewrite text, add or delete a node, move a node up or down, and collapse a branch to see the shape of a large document.

Does it validate against a schema or DTD?

No. The parse reports a position for malformed input, but schema validation is not performed.

Does it preserve whitespace exactly?

No. Insignificant whitespace is normalised by the writer.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.