A README looks great in an editor. Then a client, a teacher or a manager asks for a PDF, and pasting it into a word processor wrecks the headings and tables. To convert Markdown to PDF cleanly you have a few routes, and the best one depends on how often you do it.

Contents

The quick way: an online converter

  1. Open Markdown to PDF.
  2. Choose your .md, .markdown or .txt file, or paste the Markdown into the box.
  3. Pick A4 or Letter, portrait or the wide page orientation, and a font size.
  4. Click Convert to PDF, then download the file.

The PDF has real, selectable text. Headings, lists, tables, code blocks, quotes and links carry over. The conversion runs in your browser, so your notes are not uploaded anywhere. Most files finish in a few seconds.

Other ways to convert Markdown to PDF

  • Pandoc. The standard command-line tool. It gives the most control, with LaTeX styling and citations, but you need to install it and a PDF engine.
  • VS Code extensions. Handy if you already live in the editor. Most rely on a bundled browser engine, which makes the install large.
  • Print to PDF from a preview. Render the Markdown in any previewer and use the browser print dialog. Page breaks are hard to control.
  • Convert to HTML first. If your Markdown is already HTML, HTML to PDF may fit better.

For a one-off file, the online route wins on speed. For a book with a table of contents and custom fonts, use Pandoc.

Tips for a clean result

  • Leave a blank line before lists and tables, or some parsers read them as one paragraph.
  • Keep tables simple. One line of text per cell prints best.
  • Watch the character set. Standard PDF fonts cover Latin text. Arabic, CJK and emoji are replaced with a question mark, so use a different tool for those.
  • Images are left out of this converter, so mention figures in text if the reader needs them.

Common problems and fixes

The table prints as plain text. The header row needs a separator line of dashes under it, and every row needs the same number of pipes. Add the missing line and convert again.

Question marks appear in the text. Those are characters outside the Latin set, such as curly symbols copied from other apps or non-Latin letters. The tool reports how many it replaced, so you can search your file for them and swap in plain characters.

A code block looks cramped. Check the PDF at normal zoom before sending it. If a very long line is hard to read, break it by hand in the .md file.

The page count is higher than expected. Lower the font size one step and convert again. Headings and code blocks add spacing, so a 10-page Markdown file can reasonably become 14 pages.

Going the other direction? PDF to Markdown rebuilds headings, lists and tables from a PDF, which is useful before sending a document to an AI tool. See also our guide on cropping a PDF without losing text, and the Markdown Guide for syntax.

FAQ

How do I convert a Markdown file to PDF?

Open the Markdown to PDF tool, choose your .md file or paste the text, pick the page size and click Convert to PDF.

Does the PDF keep real, selectable text?

Yes. The text is written as text, not as a picture, so you can search it and copy from it.

Can it handle Arabic, Chinese or emoji?

Not yet. The tool uses standard PDF fonts that cover Latin characters. Other characters are replaced with a question mark, and the page tells you how many were replaced.

Do tables and code blocks survive?

Yes. Headings, lists, tables, code blocks, quotes and links are laid out in the PDF. Images are not embedded.

Is my file uploaded?

No. The conversion runs in your browser tab, so the file stays on your device.