Convert XML to HTML
XML has no look of its own. An XSL stylesheet says which tags become table rows, headings and links. Try the catalog below, then swap in your own data.
Last updated: · What changed: Added an accuracy table, coverage statement and Chrome 158 sourcing, and a new operator section on the About page.
How the catalog sample works
The XML holds three products with a SKU attribute, a name, a price and a stock count. The stylesheet has one template for the catalog element. It sorts the products by price with xsl:sort, writes one table row for each, formats the price to two decimals and prints “Sold out” when the stock is zero.
Edit a price or add a product in the XML box and convert again to see the row change. Change the stylesheet to see the HTML change. Nothing leaves your browser.
Other ways to get HTML from XML
- For a one-off file, this page is the quickest.
- For a site that rebuilds, run the transform in your build with
xsltprocor a Node script; see how to migrate from XSLT. - For a sitemap or feed that only needs to look tidy, a CSS stylesheet is lighter than HTML.
Questions
Can XML be converted to HTML without a stylesheet?
Not in a meaningful way, because XML tags carry no display meaning. Something has to map your tags to HTML elements, and that something is an XSL stylesheet, a template in code, or CSS applied directly to the XML.
Do I need to know XSLT to use this?
No for the samples: pick one, press the button and read the result. To convert your own data you need a stylesheet. If a plugin created your file, the stylesheet is the .xsl file named in its first lines; the checker shows that address.
Which XSLT engine does the converter use?
The converter loads the open-source XSLT polyfill from this site: libxslt compiled to WebAssembly, BSD-3-Clause licensed. It does not call the browser's own XSLT, so it works the same after browsers remove it.
Is my XML uploaded anywhere?
No. The converter, the validator and the CSS generator run in your browser and nothing you paste or upload is sent to our server. Only the URL checker contacts a server, and only to fetch the public address you typed.
Can I convert JSON or CSV?
No. This converter takes XML and an XSL stylesheet. Convert other formats to XML first, or use a tool made for them.