Convert markdown to PDF
Paste markdown or open an .md file, and a typeset PDF appears beside it as you type. Wide tables, long code lines, and long links wrap to fit the page instead of running off its edge.
The PDF appears here.
How to use it#
- Paste or type your markdown into the box, or open an .md file with Open file or by dropping it on the box.
- Add any pictures the markdown shows with Add pictures, or drop them on the list.
- Choose the paper, the margins, the text size, and whether the headings are numbered.
- Wait for the PDF to appear. The first one downloads the typesetter, about 20 MB, and later ones start at once.
- Download the PDF.
How the PDF is made#
The markdown is turned into LaTeX, and pdfLaTeX from TeX Live 2023 typesets it in this tab, the program academic papers and books are set with. Lines are justified and hyphenated, and the PDF holds real text, so it can be searched, copied from, and read aloud.
Headings, bold, italic, links, lists, numbered lists that start at any number, task lists, block quotes, footnotes written as [^1], and tables all come across, with the left, centre, and right alignment from a table's divider row. A front matter block at the top with a title, author, or date becomes the title block.
Math between dollar signs is typeset as math, the same way a LaTeX paper sets it: $x^2$ or \(x^2\) in a sentence, and $$…$$, \[ \], or a code block marked math on a line of its own. Prices are left alone, so "$5 and $10" prints as two prices.
Tables, code, and long lines stay on the page#
A table of sentences is laid out to the width of the page: the columns of long text wrap, each given room by how much it holds, and short columns such as a name or a date keep to one line. A table of many short numbers, such as twelve months of figures, steps down a size first. If it still does not fit, it splits into parts stacked one under another, each with the header for its own columns. A short first column, such as an item name, repeats in every part, so each row can still be read across. A table longer than most of a page breaks across pages with its header repeated at the top of each.
A line of code wider than the page wraps, with a small arrow where it carries on, rather than running off the edge. A long file path, web address, or hash in a sentence breaks after a slash or a dot, where it reads naturally across two lines.
Narrow margins give a line about as long as a word processor's, which suits notes and documentation. Standard keeps LaTeX's own wide margins, set for the shorter lines of a book, and fits about a quarter fewer characters on each line. The text can be any size from 8 to 20pt, in half points. A larger size wraps a table sooner, and a very wide one splits into more parts.
Pictures#
A picture written as  is matched by its file name, diagram.png, to the pictures you add, wherever the markdown says it lives. A picture alone in its paragraph is centred with its alt text as a caption, and shrunk if it would be taller or wider than the page. Until it is added, a box with its name stands in its place, so you can see what is missing.
PNG, JPG, and PDF pictures go in as they are. WebP, GIF, AVIF, BMP, and HEIC are converted on the way in, and a phone photo is turned upright, since the PDF otherwise shows it the way the camera stored it. An SVG has to be turned into a PNG first, with the SVG to PNG converter.
A picture given as a web address, such as the badges at the top of most READMEs, is left out, since the page does not fetch anything. Save one and add it under its file name to include it.
What it cannot print#
Raw HTML tags such as <div> or <details> have no place in the PDF, so they are left out and the words inside them kept. Chinese, Japanese, Korean, Arabic, and Hebrew have no font here, and each character shows as a boxed question mark; accented Latin letters, Cyrillic, symbols, and emoji print.
LaTeX commands written into the markdown, such as \newpage or \tableofcontents on a line of their own, are passed to LaTeX as they are, which is how to add a page break or a table of contents listing every heading. A mistake in one, or in the math, stops the PDF, and the error quotes the text it stopped at so you can find it in what you wrote.
Frequently asked questions#
Is my markdown uploaded?
#
No. The conversion and the typesetting both run in this tab, so your notes and pictures, and the PDF made from them, stay on your device. What does download, the first time, is the typesetter itself, the same files for everyone.
Why does the first PDF take a while?
#
The first one downloads TeX, about 20 MB, which your browser keeps, so the next visit starts much sooner. After that, each change makes a new PDF in a second or two, longer for a long document.
Letter or A4?
#
The page starts on the paper your browser's region uses: letter in the United States, Canada, Mexico, and a few other countries, and A4 almost everywhere else. Switch it under Paper; the text reflows to the new page.
Why is there a box where my picture should be?
#
The picture has not been added yet. Drop the file on the Pictures list, or press Add pictures, under the name the markdown gives it, and the box is replaced by the picture.
Can I write math?
#
Yes. Write it as LaTeX between dollar signs, $\frac{a}{b}$ in a sentence or $$…$$ on a line of its own, the way most markdown editors and AI chats write it, and it is typeset as an equation would be in a paper.
How do I convert an .md file to PDF?
#
Press Open file, or drop the file on the box, and the PDF is made from it. It opens .md, .markdown, and .txt files, and Download .pdf saves the PDF under the same name, so notes.md comes back as notes.pdf. The file is read in this tab, not uploaded.
Can I turn an AI chat's answer into a PDF?
#
Yes. The copy button under an answer usually copies it as markdown, so paste that here. Its headings, tables, and code come across, and its math, which chats write between \( \) and \[ \], is typeset rather than printed as code.
Can I convert a GitHub README?
#
Yes. Tables, task lists, code blocks, and footnotes come across, and the badges at the top, which are pictures on other sites, are left out. Pictures stored in the repository need adding under their file names.
Can I change the font or the look?
#
Not on this page, which sets every PDF in Latin Modern with spaced paragraphs. For full control, turn the markdown into a .tex file with the markdown to LaTeX converter, change what you like, and make the PDF with LaTeX to PDF.
Why did the PDF stop with an error?
#
Markdown alone always makes a PDF, so the cause is math or a LaTeX command written into it, such as a dollar sign opened and never closed, or a misspelt command. The error quotes the text it stopped at, so search your markdown for that and fix it.