XML File Viewer & Formatter

Open any XML file as a collapsible tree, highlighted code or a table - with exact error lines, XPath search and one-click formatting. Convert XML to JSON for the JSON Viewer, preview graphics in the SVG Viewer, open Apple .plist files in the Plist Viewer, or browse all file viewers.

or paste XML
Ctrl + Enter to view
Try a sample
Tree, code, table XPath No upload

How to view an XML file online

  1. Open your XML. Drop one or more .xml files (or .svg, .rss, .xsd, .kml, .plist and more), paste XML text, or try a sample.
  2. Explore it. Browse the collapsible tree, read the formatted or raw code, or see repeating records as a table. Search the text or run an XPath query.
  3. Fix errors. If the file is not well-formed, the viewer shows the exact line and column with a hint, so you can fix it and reload.
  4. Convert or download. Beautify or minify, copy an element’s XPath, export to JSON, YAML or CSV, or download all open files as a ZIP.

Shortcuts: Ctrl + F search, Enter / Shift + Enter next and previous match, Ctrl + S download, Ctrl + O open, arrow keys move through the tree.

You can also paste XML anywhere on the page with Ctrl + V.

XML viewer features

Collapsible tree

Fold and unfold any element. Click one to see its path and copy its XPath or the element itself.

Highlighted code

Formatted and raw views with line numbers, word wrap and five color themes - Light, VS Code, GitHub, Monokai and Dracula.

Table view

Repeating records like products, feed items or sitemap URLs become rows and columns you can sort and export to CSV.

XPath and search

Run XPath queries with highlighted results, or search text and regular expressions in every view.

Exact error lines

Well-formedness is checked as the file opens. Errors show the line, the column and a hint for the fix.

XML to JSON, YAML, CSV

Convert the whole document to JSON or YAML, or a table of records to CSV for Excel and Google Sheets.

Tabs and split view

Open several files at once, compare two side by side, and download them all as a ZIP.

100% private

Everything happens in your browser. Nothing is uploaded and outside files are never fetched.

Special XML files it understands

Some XML formats get an extra summary tab on top of the tree and code views.

  • sitemap.xml - every URL with its last-modified date, duplicates and limit checks. Build a new one with the Sitemap Generator or test the links with the Broken Link Checker.
  • RSS and Atom feeds - a clean list of posts or podcast episodes with dates and links, shown as plain text.
  • SVG graphics - a safe image preview (scripts never run) next to the code. Convert it with SVG to PNG.
  • plist, KML and GPX - Apple property lists as key/value rows, map placemarks, and GPS tracks with distance and time.
  • Office XML parts - text from a Word document.xml and the strings of an Excel sharedStrings.xml. For the whole file, use the DOCX Viewer or Excel Viewer.

Common XML errors and how to fix them

Most broken XML comes from a handful of small mistakes.

The viewer points to the exact line and column, and explains which one it is.

ErrorBrokenFixed
Bare ampersand?a=1&b=2?a=1&b=2
Mismatched tags<b><i>x</b></i><b><i>x</i></b>
Unquoted attribute<a id=5><a id="5">
Two root elements<a/><b/><r><a/><b/></r>
Space before <?xml␣<?xml ...?><?xml ...?> on line 1
HTML entity&nbsp;&#160;
Raw < in texta < ba &lt; b

Files that are really another format open better elsewhere: try the HTML Viewer, JSON Viewer or Text Viewer.

About XML files

XML (eXtensible Markup Language) is a text format for storing and moving structured data.

It is readable by people and machines, which is why it powers config files, web services (SOAP, WSDL), document formats and feeds.

An .xml file is plain text, so any editor opens it. Without highlighting, a tree and error checking, though, a big file is hard to read - that is what this viewer adds.

Many formats are built on XML: XSD schemas, XSL/XSLT stylesheets, SVG graphics, RSS and Atom feeds, plist, WSDL, GPX and KML. Microsoft Office files are ZIP packages full of XML - peek inside with the ZIP File Viewer.

When to use an online XML viewer

  • Quick inspection - read a downloaded feed, config or export without a heavy editor.
  • Restricted devices - view XML on Chromebooks, tablets or locked-down work PCs.
  • Validate fast - catch a broken tag or a bare & before it breaks a build or an import.
  • Compare versions - load two files side by side to spot what changed.
  • Reshape data - turn XML into JSON, YAML or CSV for APIs, scripts and spreadsheets.

Working with other formats? Use the YAML Viewer for configuration, the CSS Viewer and JS Viewer for code, or the CSV Viewer for exported tables.

Frequently Asked Questions

Drop the .xml file onto this page or paste its text. It opens instantly as a collapsible tree and as formatted, color-coded code.

It works on Windows, Mac, Chromebooks, phones and work PCs where you can’t install anything.

Yes. The file is read and parsed in your browser and never uploaded.

External DTDs and entities are never fetched, and entity bombs are stopped before they can freeze your tab.

The viewer checks that the document is well-formed: every tag is closed in the right order, attributes are quoted, & and < are escaped and there is one root element.

If something is wrong you get the line, the column and a hint for the fix. It does not validate against an XSD or DTD schema.

Yes. Press JSON to download the document as JSON - attributes become @keys, text becomes #text when needed and repeated elements become arrays.

You can also export YAML, or CSV from the Table view, and open the result in the JSON Viewer.

Beautify re-indents the XML with 2 spaces, 4 spaces or tabs so it is easy to read. Minify removes the whitespace between tags to make the file smaller.

Text inside elements, CDATA and xml:space="preserve" sections are kept exactly.

Any XML-based file: .xml, .xsd, .xsl and .xslt, .svg, .rss, .atom, .plist, .wsdl, .gpx, .kml, .config, .xaml, .resx and more.

Sitemaps, RSS and Atom feeds, SVG, plist, KML and GPX files and Word or Excel XML parts also get a special summary view.

Yes, up to 50 MB. Parsing runs in a background worker so the page stays responsive, and the tree and code views only draw the rows on your screen.

Open the Tree view, type an expression like //item/title or //book[@id="bk102"] in the XPath box and press Run.

Matching nodes are highlighted in the tree, and clicking any element shows its XPath so you can copy it.

Guides & Tutorials

All 14 guides
Guide How to Tell What Format an Image File Is (5 Easy Ways) Read the guide Guide How to Open ZIP, RAR, 7Z & TAR.GZ Files Online (Without Installing Anything) Read the guide Comparison PNG vs JPG: Which Image Format Should You Actually Use? Read the guide