Why convert TYP to HTML?
A .typ file is Typst source only the compiler understands, while .HTML is what browsers and the web need. Exporting turns a Typst document into a web page so it can be published online or embedded rather than shared as a PDF.
How to convert TYP to HTML
typst-cli (native HTML export)
Run typst compile --features html --format html main.typ main.html, or set TYPST_FEATURES=html. Output is a single semantic HTML file.
Pandoc (via Typst reader)
As an alternative run pandoc main.typ -o main.html with Pandoc 3.1.8+ to get a styled, standalone HTML page from the Typst source.
About these formats
A .typ file is a plain-text source document written for Typst, an open-source markup-based typesetting system. It holds your text mixed with Typst markup, math, and scripting, which the…
Open .TYP details →An HTML file is a web page - plain text with markup tags that a browser turns into the formatted page you see. To view it, double-click and it opens in your browser (Edge, Chrome, Firefox,…
Open .HTML details →Quality & what to watch
- Typst's HTML export is experimental and behind a feature flag - the docs warn against production use.
- The native exporter outputs semantic markup only and no CSS, so the page is unstyled until you add your own stylesheet.
- Complex layout, positioned graphics, and some packages are incomplete or unsupported in HTML output.
Frequently asked questions
Why do I need the --features html flag?
html feature flag; without it the format is unavailable.Why is my HTML unstyled?
Is this safe for a production website?
Can Pandoc do this instead?
pandoc main.typ -o main.html reads the Typst source and produces a standalone HTML file.