Five ways to convert Markdown to PDF, and what each one costs you

There are five practical routes from a Markdown file to a PDF: printing from a browser or editor preview, a VS Code extension, an online converter, Pandoc with a LaTeX engine, or a hosted typesetting tool. They differ almost entirely in how much control you get over the page — and the page is the whole problem.

Markdown has no concept of a page. It describes structure — this is a heading, this is a list — and says nothing about where paper ends. Every tool below is a different answer to the question the format refuses to answer, and that is the only axis worth comparing them on.

Below: what each route actually does, what it is genuinely good at, and the specific thing that will eventually make you look for something else.

1. Print to PDF from a preview

Open your Markdown in any preview — a browser, an editor pane, a notes app — and print to PDF. It costs nothing and takes ten seconds.

Good for: a draft someone needs to read once. Internal notes. Anything where the file is a courier and nobody looks at it twice.

Where it stops: you are printing a web page, not making a book. The browser decides where pages break, and it decides badly — headings stranded at the bottom of a page, tables that lose their header row halfway down, an image torn across the fold. You get the browser's own header and footer unless you remember to turn them off. Margins are whatever the print dialog offers, not measurements you chose. And the typefaces are whatever the preview happened to use.

2. A VS Code extension

Extensions like Markdown PDF render your file through a headless browser and save the result. This is a genuine step up: you can point them at a CSS file, so the type and spacing become yours rather than the default stylesheet's.

Good for: developers who are already in the editor, want repeatable output, and are comfortable writing CSS to get it.

Where it stops: you are now maintaining a stylesheet for print, which is a different discipline from styling a screen. Page breaks, running headers, widow and orphan control and page numbering all live in CSS rules most people have never used, and browser support for the print-specific ones is uneven. It works, and then a month later you are debugging why page-break-inside: avoid did nothing.

3. An online converter

Paste Markdown into a box, get a PDF back. No install, no account, no learning curve.

Good for: one file, once, when you do not care what it looks like.

Where it stops: in three places. The output is generic — one default look, no control over type or margins. Many stamp the file with their own branding, which is fine for a memo and not fine for anything you intend to sell or hand to a client. And you are uploading a manuscript to a service whose retention policy you have not read, which is worth a thought if the draft is not yours to leak.

4. Pandoc with a LaTeX engine

Pandoc is the serious answer, and it deserves its reputation. Pointed at a LaTeX engine, it produces genuinely beautiful books — real typesetting, with the hyphenation and justification decisions that make a page look professionally set rather than merely tidy.

pandoc book.md -o book.pdf --pdf-engine=xelatex

Good for: technical books, academic work, anything with heavy cross-referencing, citations or mathematics. If your document has a bibliography, this is the correct tool and nothing else is close.

Where it stops: the first line above works. The second week does not. Changing a typeface means learning fontspec. Changing margins means geometry. Wanting a cover image, a different look for chapter openings, or a running header with the chapter name in it means a custom template, which means learning enough LaTeX to debug someone else's. There is also no preview: you compile, look, adjust, compile again, and the loop is slow enough that most people stop adjusting long before the book is right.

5. A hosted typesetting tool

The last route is to hand the page problem to something built for it: you keep writing Markdown, and the pagination, embedding and layout are handled, with the design exposed as a handful of controls rather than a configuration language.

This is what bukpress does. Type is three choices — title, subtitle, body — each with its own size and colour. The page is a paper texture or your own image, with margins in points and page numbers on or off. Covers are files you upload. The preview paginates with the same rules the export uses, so what breaks on page seven on screen breaks on page seven in the file.

Good for: anyone whose bottleneck is the design rather than the writing, and who wants the output to be defensible without becoming a typesetter to get there.

Where it stops: it is opinionated. You get the controls a book needs and not an arbitrary layout canvas — no text wrapping around a floated illustration, no multi-column magazine spreads, no pinning an element to a specific spot on page four. If your document is really a designed artefact rather than a book, a layout application is still the right tool.

Side by side

PrintVS CodeOnlinePandocHosted
SetupNoneMinutesNoneHoursNone
Control over typeNoneVia CSSNoneVia LaTeXDirect
Real page breaksNoFragileNoYesYes
Fonts embeddedSometimesYesVariesYesYes
Live preview of pagesNoNoNoNoYes
CoversNoManualNoTemplateUpload
CostFreeFreeFree / paidFreeFree / paid

How to choose in one question

Ask what happens to the file after you make it.

  • Read once, then discarded — print to PDF and stop reading articles like this one.
  • Regenerated constantly by a build — Pandoc, or a VS Code extension if the styling needs are light.
  • Cited, with mathematics or a bibliography — Pandoc with LaTeX. This is not a close call.
  • Sold, or sent to a client, or printed — you need control over the page, and the choice is between learning a typesetting system and using one that has already been configured.

The mistake worth avoiding is the middle: spending three evenings fighting a print stylesheet for a document that needed to be finished on Tuesday. Whatever you pick, pick it on the basis of the document's destination, not on which tool you happened to open first.

If it helps to see the far end of that spectrum, the sample book is eight pages exported from bukpress with nothing touched afterwards — page breaks, a real table, embedded type and the margins actually set. It costs nothing to open and it is a faster answer than any comparison table.

Read next

How-to · 5 min read

How to control page breaks in Markdown

Markdown has no page break because it describes structure, not pages — so every method is really an instruction to whatever renders it. The three that work are a raw HTML div with a CSS page-break rule, a LaTeX \newpage command through Pandoc, or a renderer that assigns a meaning to a plain-text marker.

Read it
Tools · 4 min read

Pandoc for books: what it is superb at, and where it stops

Pandoc is the best tool available for documents with citations, cross-references or mathematics, and for any book whose production is automated by a build. It stops being the pragmatic choice when your requirements are visual rather than structural, because every visual change is made by writing LaTeX or a template.

Read it
Explainers · 4 min read

Why your PDF looks wrong on someone else's computer

Because the font was referenced rather than embedded. A PDF can either carry a copy of the typeface inside the file or just name it and hope the reader's machine has it — and when it does not, the reader silently substitutes something else, which changes the line breaks and the page count along with the look.

Read it

Write it in Markdown. Ship a book.

bukpress turns the file you are already writing into a typeset PDF and EPUB — your type, your covers, no watermark on any plan.

Start free — no card required