Home › Developer Tools › XML Viewer

XML Viewer

Open an XML file or paste XML to explore it as a collapsible tree. Click any element to see its attributes, text and exact XPath, search across tags, attributes and text, or run your own XPath query. Large files up to 100 MB load in your browser without uploading.

Last updated:

Tip: you can also drop a file anywhere on this box. Files up to 100 MB are supported.

Advertisement
Advertisement

How to use the XML Viewer

  1. Open or paste XML: choose a file, drop it on the box or paste text, then press View XML. A sample catalog is shown on load.
  2. Browse the tree: click the arrows (or use the arrow keys) to open elements. Use Expand 2 levels or Expand all for an overview.
  3. Select a node to see its type, namespace, attributes, text and XPath in the side panel.
  4. Copy the XPath or the node's XML for use in code, tests, XSLT or scraping rules.
  5. Search or query: type text to find matching tags, attributes or text, or enter an XPath such as //book[price>15]/title and press Find.

XPath quick reference

XPath 1.0 is the query language built into browsers, XSLT and most XML libraries. Paste any of these into the XPath box to try them on the sample.

ExpressionSelects
/library/sectionEvery section child of the root library
//bookAll book elements anywhere in the document
//book[2]Each book that is the second book child of its parent
(//book)[last()]The last book in the whole document
//book[@format='paperback']Books whose format attribute equals paperback
//book[price > 15]/dc:titleTitles of books priced over 15 (prefixes declared in the file work)
//book/@idThe id attributes (the viewer jumps to their elements)
//*[contains(text(), 'Soup')]Elements whose text contains "Soup" (case-sensitive)
count(//book)A number: how many books there are
//*[local-name()='entry']entry elements in any namespace, for example in Atom feeds

Node types you will see in the tree

  • Elements such as <book id="b101">, shown with up to six attributes and the number of child elements. Elements that only hold a short text value are shown on one line.
  • Text between tags. Whitespace used only for indentation is hidden.
  • CDATA sections (<![CDATA[ … ]]>) hold text that may contain < and & without escaping.
  • Comments (<!-- … -->) and processing instructions (<?target data?>), such as stylesheet links.

To make XML readable as text, use the XML Formatter; to check it against a schema, the XML Validator; and to work with the data in JavaScript, XML to JSON.

Frequently asked questions

How do I open an XML file?

Click Open XML file or drop the file on the tool. It is read by your browser and shown as a tree, with nothing uploaded. Any XML-based format works, including .xml, .xsd, .xslt, .svg, .rss, .kml, .gpx, .plist, .config and .csproj files.

How is the XPath of a node built?

The absolute XPath lists every step from the root, adding a position like [2] only when the parent has more than one child element with the same name, for example /library/section[2]/book/author. If an ancestor has an id attribute, a shorter path anchored on it is also shown, such as //book[@id='b101']/author.

Why does my XPath query find nothing when the XML has xmlns?

When elements live in a default namespace (xmlns="…" without a prefix), XPath 1.0 cannot match them with plain names. Use *[local-name()='book'] for those steps; the XPaths this viewer copies already do that. Prefixed names such as dc:title work directly because the prefixes declared in the document are recognized.

Can it open very large XML files?

Files up to 100 MB can be opened. The tree only builds the rows you actually expand, 300 children at a time, so even documents with hundreds of thousands of elements stay responsive. Large files are not copied into the text box, which keeps typing and scrolling fast.

What does 'not well-formed' mean?

XML must follow strict rules: one root element, every tag closed, tags properly nested, attribute values in quotes, and special characters such as & and < escaped as &amp; and &lt;. The viewer shows the first error with its line and column and points to the spot.

Does the viewer change or upload my XML?

No. The file is parsed by your browser's built-in XML parser and is never sent anywhere. The tree is read-only; to reformat or minify XML use the XML Formatter.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

XML FormatterBeautify, validate and minify XML with a collapsible tree view.XML ValidatorCheck if XML is well-formed, see the exact line and column of each error and pretty-print it.XML to JSONConvert XML to JSON with validation.JSON ViewerExplore JSON as a collapsible tree, search keys and values and copy any node's path.JSON to Excel ConverterTurn JSON into a styled .xlsx spreadsheet; nested arrays become their own linked sheets.JSON to CSVConvert JSON data to CSV for spreadsheets.CSV to JSONConvert CSV data to JSON with live preview.Excel to CSVConvert XLSX spreadsheets to CSV.CSV ViewerOpen a CSV or TSV file as a sortable, filterable table.Excel Viewer (XLSX / XLS)Open XLSX, XLS and ODS spreadsheets in your browser without Excel.Line Ending ConverterConvert text and files between CRLF, LF and CR line endings.Markdown to HTMLConvert Markdown to clean HTML with a live editor.Text Encoding ConverterDetect and convert text file encodings like UTF-8, UTF-16 and Latin-1.TTF to WOFF2 ConverterConvert TTF and OTF fonts to WOFF2 or WOFF and get a ready @font-face CSS snippet.Chmod CalculatorConvert Linux file permissions between checkboxes, octal (755) and symbolic (rwxr-xr-x) notation.JSON to TypeScriptGenerate TypeScript interfaces or types from JSON, with nested types and optional fields.Morse Code TranslatorTranslate text to Morse code and back, then play it as sound or a blinking light, or save a WAV.HTML Table GeneratorBuild HTML tables in an editable grid with styles, header rows, CSV import and live preview.Hex to Text ConverterConvert hex to text and text to hex with UTF-8 support and space, 0x, \x or comma formats.JSON to XML ConverterConvert JSON to well-formed XML with attributes, arrays and pretty print.JSON to YAML ConverterConvert JSON to clean YAML as you type, with indent, quoting and sort options.YAML to JSON ConverterConvert YAML to pretty or minified JSON, with errors pinned to the exact line.HTML to Markdown ConverterTurn HTML or pasted rich text into clean Markdown with tables and live preview.Markdown Table GeneratorBuild Markdown tables in a grid or paste from Excel/CSV, with alignment and preview.JSON ValidatorCheck JSON with the exact line and column of each error, fix tips and one-click auto-fix.Image to Base64Convert images to Base64 data URIs, CSS backgrounds and HTML img tags in your browser.Base64 to ImagePaste a Base64 string or data URI to preview, identify and download the image.JSON CompareCompare two JSON documents and see every added, removed and changed path.Hex to DecimalConvert hex to decimal instantly with steps and signed mode.Decimal to HexConvert decimal to hex instantly with steps and signed mode.Binary to DecimalConvert binary to decimal instantly with steps and signed mode.Decimal to BinaryConvert decimal to binary instantly with steps and signed mode.Two's Complement CalculatorDecimal to two's complement binary and back for 4-64 bits, with invert-and-add-1 steps.XML to CSV ConverterConvert XML to CSV: detects repeating records, flattens nested data, pick your columns.CSV to XML ConverterConvert CSV to well-formed XML with custom root and row names, escaping and pretty print.TOML to JSON ConverterConvert TOML to JSON and JSON to TOML with a full v1.0 parser and clear error lines.JSON to Go StructTurn JSON into Go structs with inferred types, nested structs and json tags.JSON to Python ClassGenerate Python dataclasses, Pydantic models or TypedDicts with type hints from JSON.Properties to YAML ConverterConvert Java .properties to nested YAML (application.yml) and YAML back to properties.PX to EM ConverterConvert pixels to em using the parent font size, and em back to px, with conversion tables.Query String to JSONConvert URL query strings to JSON with nested brackets and arrays, and JSON back to a query string.REM to PX ConverterConvert CSS rem values to pixels for any root font size, with a quick 0.25–6rem table.SQL to JSON ConverterConvert SQL INSERT statements and dumps into a JSON array of row objects, with CSV export.TSV to CSV ConverterConvert TSV to CSV and back, or between tab, comma, semicolon and pipe, with correct quoting.TypeScript to JavaScriptConvert TypeScript or TSX to clean JavaScript instantly: strip types, keep or compile JSX.XML to YAML ConverterConvert XML to clean YAML with attributes, text nodes, lists and exact error lines.YAML to XML ConverterConvert YAML to pretty, well-formed XML with custom root, attributes and array item tags.Boolean Algebra SimplifierSimplify boolean expressions or minterm lists to minimal SOP and POS with Quine-McCluskey steps.Compare Excel FilesCompare two Excel spreadsheets cell by cell, highlight changes and export a diff report.CSV CleanerClean messy CSV in one click: trim spaces, drop empty rows and columns, fix headers, dedupe.CSV VLOOKUP ToolJoin two CSV or Excel files on a key column like VLOOKUP, with left, inner and full joins.Remove Duplicates in ExcelFind and remove or highlight duplicate rows in XLSX or CSV files by the columns you choose.GeoJSON ViewerView GeoJSON on a map, inspect and edit properties, validate against RFC 7946 and export.GPX ViewerOpen GPX tracks on a map with distance, elevation profile, moving time, speed and splits.JSON Repair ToolFix broken JSON automatically: trailing commas, quotes, comments, truncated data, with a diff.Karnaugh Map SolverSolve 2–6 variable K-maps: click cells or enter minterms to get the minimal SOP or POS with groups.Merge Excel FilesCombine XLSX, XLS and CSV files into one workbook or append all rows into a single sheet.Parquet File ViewerOpen Apache Parquet files in your browser: schema, rows, filters and CSV or JSON export.Query CSV with SQLRun SQL on CSV, Excel, JSON and Parquet files in your browser with DuckDB. Join and export.Online Serial MonitorTalk to Arduino, ESP32 and USB serial devices in your browser: log, send, plot and save.Split Excel FileSplit an Excel sheet into several files by row count or by each value in a column, as ZIP.SQL Create Table GeneratorDefine columns, keys, defaults and indexes; get CREATE TABLE SQL for MySQL, Postgres and more.SQL IN Clause GeneratorTurn a pasted list into a SQL IN ('a','b') clause with quoting, dedupe and 1,000-item chunks.SQL Online CompilerRun SQL queries online on SQLite with sample databases, a result grid, CSV export and .db save.SQL to ER DiagramPaste CREATE TABLE statements and get an entity-relationship diagram with keys and links.XML to XSD GeneratorGenerate an XML Schema (XSD) from sample XML: types, occurrences, attributes and namespaces.Wildcard Mask CalculatorConvert a subnet mask or CIDR to a wildcard mask for ACLs and OSPF, with range and binary.CSV to VCF ConverterConvert a contacts CSV into a vCard (.vcf) file, mapping columns to name, phone, email and more.
See all 129 Data & File Format Converters →