Free Online XML Editor, Formatter, Validator and Viewer
xml.editor.free lets you edit, format, validate, view, compare and convert XML directly in your browser. Nothing is uploaded to a server — parsing, formatting and conversion all run locally using your browser's own JavaScript engine, so your documents stay on your device.
What is an XML editor?
An XML editor is a tool for writing, reading and checking XML (Extensible Markup Language) documents. A good XML editor does more than provide a text box — it highlights syntax, auto-closes tags, points out malformed markup, and helps you explore deeply nested structures without losing your place. This tool adds a live tree view, an XPath tester and an XML-to-JSON converter on top of a full-featured code editor, so you can inspect and transform XML without installing any desktop software.
How to format XML online
Paste or open your XML in the editor on the left, then click Format in the toolbar (or press Ctrl/Cmd + Shift + F). The formatter re-indents your document using the indentation set in Settings (two spaces by default) while preserving attributes, namespaces, comments, CDATA sections and processing instructions. If the document can't be parsed, you'll see a clear error instead of a corrupted result — run Validate first to locate the problem.
How XML validation works
Validation in this tool checks whether your XML is well-formed using the browser's built-in DOMParser: every tag closed and correctly nested, exactly one root element, properly quoted attributes and no duplicate attribute names. When something is wrong, the Validation tab explains the problem in plain language and points you to the affected line. This is not the same as XSD or DTD schema validation, which checks a document against a defined structure and set of rules — this tool never claims to do that.
XML vs JSON
| XML | JSON | |
|---|---|---|
| Structure | Tags, attributes, text nodes | Objects, arrays, key-value pairs |
| Verbosity | More verbose, closing tags required | More compact |
| Metadata | Attributes and namespaces built in | No native attribute concept |
| Common use | Documents, feeds, config, SOAP | APIs, app configuration, data interchange |
Because the two formats model data differently, converting XML to JSON requires a convention for attributes and text. This tool uses @attributes for an element's attributes and #text for text content, with repeated sibling elements automatically turned into arrays.
How to use XPath
XPath is a query language for selecting parts of an XML document. Switch to the XPath tab, type an expression such as //book/title to select every title inside a book, or count(//item) to count matching nodes, then click Run. Results can be node-sets, strings, numbers or booleans, and each one can be copied individually. Your recent expressions are saved locally so you can reuse them.
Privacy and local browser processing
Every feature in this tool — formatting, validation, the tree view, XPath, JSON conversion and comparison — runs entirely inside your browser tab using JavaScript. Your XML is never sent to a server, logged, or stored anywhere outside your own device. Autosave, when enabled, writes only to your browser's local storage, and you can clear that saved data at any time from Settings.
Frequently asked questions
Is this XML editor free?
Yes. xml.editor.free is completely free to use, with no sign-up, no watermarks and no usage limits.
Is my XML uploaded anywhere?
No. All parsing, formatting, validation and conversion happen locally in your browser. Your XML never leaves your device.
Can I format invalid XML?
The formatter needs well-formed XML to produce a reliable result. If your document has syntax errors, run Validate first to find and fix them, then format.
Can I convert XML to JSON?
Yes. The XML to JSON tab converts your document into readable, indented JSON using clear conventions for attributes and text content.
What is XPath?
XPath is a query language for selecting nodes, text, numbers or booleans from an XML document, evaluated here using your browser's native XPath engine.
Can I open large XML files?
Yes, the editor handles large documents, though very large files may take a moment to parse and render as a tree. You'll see a warning before any resource-heavy processing.
Does the tool perform XSD schema validation?
No. This tool checks whether your XML is well-formed. It does not validate against an XSD schema or DTD.