FormatterHQ

Online XML Editor

Edit XML in the browser and see problems the moment you make them. Each change is re-checked, the tree preview follows along, and you can download or share the result.

Input XML
Output XML
Ready.

How to use the XML Editor

  1. Open your file with Upload file, drag and drop, Load URL or paste; Sample loads an example catalog.
  2. Edit directly in the input editor. With Auto update on, the Tree preview and status bar refresh as you type.
  3. Use Validate to confirm the document is well-formed, Format for indented output or Minify for a compact copy.
  4. Save your work with Download, or click Save & Share to get a link to this exact input.

An XML editor that checks every change

This online XML editor is for quick edits when opening an IDE is overkill: changing a value in a config file, adding an element to a test fixture, or fixing a feed before re-uploading it. You type in a syntax-highlighted editor, and every change is parsed again, so a missing quote or an unclosed tag shows up in the status bar right away rather than when a deployment fails.

The editing loop

The page has two halves. On the left is the text you edit; on the right is the result of the selected action. With View Tree (the default) the right side shows a collapsible tree of your document and the status bar reads something like 7 elements, root <catalog>. Add a <book> and the count goes up; forget to close it and the status bar switches to an error with the line and column.

The other buttons change what the right side shows: Format for indented markup, Validate for a well-formedness report, and Minify for a single-line version with the bytes saved.

Example: adding a record

Load the Sample catalog (three books, status 19 elements, root <catalog>) and add a fourth book just before </catalog>, but type the closing tag wrong:

  <book id="bk104" lang="en">
    <title>Oberon Legacy</title>
    <price>5.95</price>
  </Book>

The status bar immediately reports Expected closing tag 'book' (opened in line 24, col 3) instead of closing tag 'Book', followed by the position of the bad tag, line 27. XML names are case-sensitive, so </Book> does not close <book>. Change it to lowercase and the message becomes 22 elements, root <catalog>, with book now listed as 4 items in the tree.

Hand-editing XML without breaking it

  • Escape special characters in text. Write &amp; for & and &lt; for <. For a block of code or HTML, use <![CDATA[ ... ]]> instead of escaping every character.
  • Quote every attribute value, with either single or double quotes, and never repeat an attribute on the same element.
  • Keep one root element. New records go inside the root, not after it.
  • Comment out with care. <!-- ... --> cannot be nested, so commenting out a region that already contains a comment ends the outer one early.

The XML escape tool converts a snippet of text into safely escaped XML if you are pasting in content from elsewhere.

Saving and sharing

Download saves the output rather than the editor text: indented XML after View Tree, Validate or Format, and a single line after Minify. Save & Share stores your input and options and gives you a link, which is handy for showing a colleague a broken payload. Anyone with the link can open it, so do not share documents that contain credentials or personal data.

Limits of a browser editor

This editor checks syntax, not meaning. It does not load an XSD, so it cannot tell you that <price> must be a decimal or that <title> is required. Namespace prefixes are not checked against their declarations either. For schema-driven editing with autocompletion, a desktop IDE is the better tool; for fast fixes and a second pair of eyes, this page is quicker.

To see what changed between your edited version and the original, paste both into XML diff. If you only need to read a file, the XML viewer keeps the focus on the tree.

Privacy

Editing, validation and the tree preview all run in your browser. Your document is only sent to our server when you use Load URL or Save & Share.

Frequently asked questions

Does the XML editor save my work automatically?
No. The input is not stored unless you click Save & Share, which creates a link. Use Download to keep a local copy before you close the page.
Can I edit values directly in the tree?
The tree is a read-only preview. Edit the text in the input editor and the tree updates when Auto update is on.
Why does my file show an error after I pasted HTML into it?
HTML inside XML has to be escaped or wrapped in a CDATA section. Tags like
without a closing slash, or entities like  , are not valid XML on their own.
Can I open .xsd, .wsdl or .svg files?
Yes. Upload file accepts XML-based formats including .xsd, .wsdl, .svg, .rss, .xaml and .mxml, and they are edited and checked as ordinary XML.
Is there a file size limit?
There is no fixed limit because the file is processed in your browser. Very large files make typing slower; turn off Auto update while editing them and run the actions manually.

Last updated October 3, 2026

Related tools

CSV Editor Online Edit CSV files online like a spreadsheet: change cells, add, move or delete rows and columns, sort, filter, find and replace, undo, then export. Online HTML Editor Write and edit HTML with autocompletion and a sandboxed live preview, then copy or download the finished document. JSON Editor Edit JSON online with a live tree preview, instant validation and one-click formatting, repair and minification. Online Markdown Editor Write Markdown with a live side-by-side preview and the generated HTML source. Free online Markdown editor, no sign-up. Mermaid Live Editor Write Mermaid flowcharts, sequence, class, ER, Gantt and state diagrams with a live preview, then export SVG or PNG. Online Code Editor Multi-language online code editor with syntax highlighting for 30+ languages. Open, edit, save and download code files. XML Formatter Format and beautify XML online with custom indentation. Validate structure, keep comments and CDATA, and spot errors by line. XML Syntax Highlighter Highlight XML syntax online with coloured tags, attributes, values and comments. Copy the result as embeddable HTML. XML Minify Minify XML by removing indentation, line breaks and comments. Shrink SOAP payloads, sitemaps and configs while keeping them valid. XML Parser Parse XML online and inspect the resulting object tree with elements, attributes and text nodes clearly separated. XML Pretty Print Pretty print XML in the browser, with matching commands for xmllint, xmlstarlet, Python and .NET when it belongs in a script. Sort XML Online Sort XML elements alphabetically by tag name or by an attribute value, at every level. Optionally sort attributes as well.