To convert Markdown to PDF, render the .md text into formatted pages (headings, tables, code boxes, images) and print that layout to a PDF file. The quickest free way is to paste your text or drop your .md files into the WoowPDF Markdown to PDF converter, pick A4 or Letter and click Create PDF.
Below you will find that method step by step, three alternatives for people who live in VS Code or the terminal, and fixes for the problems that trip most people up: missing images, wide tables, code blocks and page breaks.
Which way to convert Markdown to PDF should you use?
Pick by what you already have installed and how often you convert. All four keep your text as real, selectable text.
| Method | Best for | Needs | Watch out for |
|---|---|---|---|
| WoowPDF online converter | One file or a folder of notes, any device | A browser | Images must be added with the .md file |
| VS Code extension | Developers converting from their editor | VS Code plus an extension | Settings live in the extension |
| Pandoc | Scripts, books, batch jobs | Pandoc plus a PDF engine | Default output needs LaTeX installed |
| Print a rendered preview | A README already shown on GitHub or in an app | Any browser | Site menus and margins can end up in the PDF |
How to convert Markdown to PDF online (step by step)
- Open the Markdown to PDF converter.
- Paste your Markdown into the text box, or drop one or more .md files onto the page. Files ending in .markdown, .mdown and .txt work too.
- Add the images your file uses in the same step (PNG, JPG, GIF, WebP or SVG).
- Choose the page size (A4 or Letter), the font (sans serif or serif) and the text size (small, normal or large).
- Turn on the table of contents if you want one. It lists your headings down to level 3 as clickable links and starts the document on the next page.
- Click Create PDF. Each .md file becomes its own PDF.
The styling is close to GitHub: clear heading sizes, bordered tables with a shaded header row and light gray code boxes. Every heading also becomes a bookmark in the PDF sidebar, so long documents are easy to move around in.
One honest note on privacy: the page is built in your browser, then sent over an encrypted connection to our server, where headless Chrome prints it to PDF. The file is deleted as soon as the PDF comes back.
Which Markdown features carry over to the PDF?
Everything in everyday GitHub flavored Markdown carries over: headings, bold, italic, strikethrough, inline code, links, nested and numbered lists, task lists with checkboxes, block quotes, horizontal rules, fenced and indented code blocks and pipe tables with left, center or right alignment. A title in YAML front matter becomes the PDF title, and the front matter block itself is hidden.
A few things to know before you convert:
- Code blocks keep a monospace font and wrap long lines instead of running off the page. They are not syntax colored.
- Raw HTML is shown as text, apart from a short list of harmless inline tags such as
<br>,<sup>,<sub>,<kbd>and<mark>. HTML comments are dropped. - Math, diagrams and footnotes (LaTeX formulas, Mermaid blocks) are not rendered. Export those as images first and link them like any other picture.
- Arabic text is laid out right to left when most of the letters are Arabic.
How do you keep images in a Markdown PDF?
Upload the image files together with your .md file. The converter matches each image by its file name, so  finds the chart.png you added, whatever folder path the text uses. Images written as data URLs always work.
Images from a web address are fetched by your browser when the hosting site allows it. If a site blocks that, or the picture takes longer than a few seconds, the PDF shows the alt text in brackets instead of a gap, so you can see what is missing. The fix is to download that image and add it with the file.
Can you add page breaks when converting Markdown to PDF?
Not with a page break tag: Markdown has no page break syntax, and inline HTML such as a page break div is shown as text in our converter. The layout does the most important work for you. A heading never sits alone at the bottom of a page, table rows are not cut in half, and a code block moves to the next page rather than splitting.
If you need a hard break, for example before an appendix, split the text into two .md files, convert both, and join the PDFs with Merge PDF. The table of contents option also starts your content on a fresh page.
How to convert MD to PDF in VS Code
VS Code has no built in PDF export, but the free Markdown PDF extension adds one:
- Open the Extensions view, search for Markdown PDF and install it.
- Open your .md file.
- Open the command palette (Ctrl+Shift+P, or Cmd+Shift+P on a Mac) and run Markdown PDF: Export (pdf). You can also right click inside the editor.
- The PDF is saved next to your .md file.
This suits people who convert often from the same machine. Relative image paths work without uploading anything, because the extension reads your folder.
How to convert Markdown to PDF with Pandoc
Pandoc is a free command line converter. Once it is installed, one command does the job:
pandoc notes.md -o notes.pdf
The catch: by default Pandoc builds the PDF through LaTeX, so you also need a LaTeX distribution. If you would rather avoid that, the Pandoc manual lists other engines you can choose with the pdf-engine option, such as weasyprint, wkhtmltopdf or typst. Pandoc shines for long documents, books and batch scripts where you want full control over templates.
How to print a Markdown preview to PDF
If your Markdown is already rendered somewhere, you can print it. Open the README on GitHub (or the preview in your notes app), press Ctrl+P (Cmd+P on a Mac), choose Save as PDF as the printer and save. Apps such as Typora and Obsidian also have their own Export to PDF command.
The downside is that you get the page as the site shows it: menus, sidebars and the site's margins can end up in the PDF, and wide tables may be cut off at the edge.
Common problems when converting Markdown to PDF
A table is too wide. Long cell text makes the table wider than the page. Shorten the cells, move long notes below the table, or split one wide table into two.
The table shows as plain text with pipes. The row under the header must hold at least three dashes for every column, separated by pipes. Also leave a blank line before the table.
Lists run together. Put a blank line before a list, and indent nested items by at least two spaces under their parent.
Images are missing. Add the image files with the .md file (see above), or replace web addresses that block downloads.
You need page numbers. The PDF has no header or footer, which keeps pages clean. Add numbers afterwards with PDF page numbers.
Convert your Markdown to PDF now
Paste your text or drop your .md files and images into the free Markdown to PDF converter, choose A4 or Letter and download a clean PDF with real tables, code boxes and bookmarks. Need to go the other way? PDF to Markdown rebuilds headings and tables from a PDF.
Frequently asked questions
How do I convert an MD file to PDF for free?
Drop the .md file into the WoowPDF Markdown to PDF converter, add any images it uses, pick A4 or Letter and click Create PDF. There is nothing to install and no sign up.
Can I convert Markdown to PDF without installing anything?
Yes. An online converter only needs a browser, so it works on Windows, Mac, Linux and phones. VS Code and Pandoc are good options too, but both need software installed first.
Does the PDF keep my tables and code blocks?
Yes. Pipe tables keep their columns, borders and alignment, and code blocks stay in a monospace box that wraps long lines. Code is not syntax colored.
Why are images missing from my Markdown PDF?
The converter cannot see files on your computer unless you add them. Upload the images together with the .md file and they are matched by file name. Images from websites that block downloads show their alt text instead.
Is the text in a Markdown PDF searchable?
Yes. The PDF contains real text, so you can search, select and copy it. Your headings also become bookmarks in the PDF sidebar.
Can I convert several Markdown files at once?
Yes. Drop several .md files on the page and each one becomes its own PDF. To end up with a single document, join the results with Merge PDF.
- markdown to pdf
- md to pdf
- markdown
- readme
- how to
Share



