To turn a .md file into a PDF on a Mac, open it in an app that formats Markdown first, then export, because a Mac saves a PDF of what the app shows and TextEdit shows # and ** symbols. The quickest way is One Clear Reader: open the file and press ⇧⌘P, with tables and diagrams kept (free to try for 30 days). Free routes with more setup are VS Code with an extension, or Pandoc in Terminal. To print, open the PDF in Preview.
Why does my PDF come out full of # and stars?
A PDF of a .md file comes out full of # and stars because the PDF is a copy of what the app shows, and TextEdit shows the symbols.
Every Mac app that can print can also make a PDF: choose File › Print, open the PDF menu and pick Save as PDF (Apple Support). That works well for a Word file or a web page. For a .md file opened in TextEdit, it faithfully saves every #, ** and |.
So turning a .md file into a PDF is always two steps:
- Get the file formatted, so headings look like headings and tables look like tables.
- Save that formatted page as a PDF.
The options below differ in how they do step 1, what it costs, and whether your tables and diagrams survive.
Which way should I use to turn a .md file into a PDF?
Pick the way to turn a .md file into a PDF by what's in your file and how often you'll do this. This table compares five routes on effort, diagrams, a client cover page, setup and cost.
| Method | Effort | Diagrams | Client cover page | No setup | Cost |
|---|---|---|---|---|---|
| One Clear Reader | One step: open the file, press ⇧⌘P | Yes. | Yes. | Yes. | Free for 30 days, then Pro |
| Typora | Open, then File › Export › PDF | Yes. | No. | Yes. | $14.99 once, 15-day trial |
| VS Code + Markdown PDF extension | Install VS Code and the extension, then run a command | Yes. | No. | No. needs an extension | Free |
| Pandoc straight to PDF | A Terminal command | No. they stay as code | No. | No. Terminal and a PDF engine | Free |
| Pandoc to a web page, then print | A Terminal command, then File › Print in your browser | No. same | No. | No. Terminal | Free |
All five keep tables. The client cover page adds a title, "Prepared for" and the date. Typora's price checked 28 September 2026.
"Diagrams" here means Mermaid, the text format AI tools use for flowcharts. If your file has no diagrams, every row works. If it does, skip the Pandoc rows unless you're happy to add a filter (more on that below). Why diagrams show up as code explains what's going on.
Every option on this page runs on your Mac. Nothing is uploaded. That matters if the file is a contract, a client plan or anything you'd rather not paste into a free converter website.
How do I save a .md file as a PDF in One Clear Reader?
To save a .md file as a PDF in One Clear Reader, open it and choose File › Save as PDF… (⇧⌘P). Pick where to save it. That's the whole job.
What you get (Pro):
- A4 pages, with the page as you see it: headings, lists, tables, code, images and diagrams.
- Selectable text, so the person you send it to can search it and copy from it.
A4 is slightly narrower and taller than US Letter. If you print it on Letter paper, choose Scale to Fit in the print dialog (see the printing section below).
A version with a cover page, for clients
Save as client PDF (Pro) adds a cover page with a title, subtitle, "Prepared for", "Prepared by" and a date. It reads those from a small block at the very top of the file, called frontmatter. Add one like this, or ask your AI to add it:
---
title: Launch plan
subtitle: Beta and public launch, October
prepared_for: Northwind Studio
prepared_by: Maya
date: 2026-10-01
---Then press ⌘K, type client and choose Save as client PDF, with a cover. It's also in the More menu.
Leave the block in the .md. Next time you export, the cover fills itself in.
How do I turn a .md file into a PDF free in VS Code?
To turn a .md file into a PDF free in VS Code, install an extension called Markdown PDF (by yzane, version 2.2.0 when checked), then export from the Command Palette.
- Install VS Code if you don't have it.
- Open the Extensions panel, search for Markdown PDF, and install the one by yzane (VS Code Marketplace).
- Open your .md file in VS Code.
- Press ⇧⌘P, type
Markdown PDF: Export (pdf), and press Return.
The PDF lands next to your .md file, on A4 pages unless you change the extension's paper format setting. It supports Mermaid diagrams and math. It uses Chrome (or Edge or Chromium) to draw the page, and if you don't have one installed it downloads its own copy the first time.
VS Code's own preview (⇧⌘V) draws Mermaid diagrams too (VS Code docs), but its docs list no way to print or export the preview. That's why you need the extension.
Honest take: good and free if you already use VS Code. A big install if all you wanted was one PDF.
How do I export a .md file to PDF with Typora?
To export a .md file to PDF with Typora, open it and choose File › Export › PDF. PDF export is built in and doesn't need anything extra (Typora support).
You can set paper size, margins, a header and a footer (for example page numbers), which is useful for a long report. Typora's docs say diagrams it has drawn are included in PDF exports (Typora support).
Typora is a writing app first. If you want to write and tidy documents as well as export them, it's a good buy. See One Clear Reader vs Typora for the differences.
How do I turn a .md file into a PDF with Pandoc?
To turn a .md file into a PDF with Pandoc, a free converter you run in Terminal, you also need a second piece of software called a PDF engine.
- Install Pandoc. Use the installer from pandoc.org, or in Terminal type
brew install pandocif you use Homebrew (Pandoc install guide). - Install a PDF engine. By default Pandoc makes PDFs with LaTeX, a typesetting system. Pandoc's install guide suggests BasicTeX or TinyTeX on a Mac, because the full MacTeX is about four gigabytes.
- Go to the file's folder in Terminal. Type
cd(with a space), drag the folder from Finder onto the Terminal window, and press Return. - Convert:
pandoc plan.md -o plan.pdfPandoc can also use other engines, such as weasyprint or typst, with the --pdf-engine option (Pandoc manual).
Two things to know:
- Diagrams stay as code. Pandoc doesn't draw Mermaid on its own. A community add-on called mermaid-filter does, but it needs Node.js and the Mermaid command-line tool as well.
- It's the most setup. Worth it if you convert files every week and like Terminal. Overkill for one PDF.
The no-LaTeX shortcut: make a web page, then print it
Skip the PDF engine by asking Pandoc for a web page instead:
pandoc plan.md -s -o plan.htmlThe -s makes a complete page. Double-click plan.html and it opens in your browser, formatted. Then choose File › Print and either print it or pick Save as PDF from the PDF menu.
How do I print a .md file so it looks like a normal document?
To print a .md file so it looks like a normal document, make the PDF first, then print the PDF from Preview. Printing the .md file directly gets you the symbols.
- Double-click the PDF. It opens in Preview.
- Choose
File › Print(⌘P). - Check the page preview on the left. Scroll through it for tables split across pages.
- Choose Scale to Fit in the Preview section of the dialog if your paper size doesn't match the PDF (A4 on Letter, say) (Apple Support).
- Set Pages per Sheet to 2 in the Layout section if you want to save paper.
- Click Print.
One Clear Reader doesn't print directly, and its PDF viewer blocks printing from inside a PDF. Save the PDF, then open it in Preview to print.
A few habits that make the printout look like a document and not a web page:
- Give the file one title at the top (a single
#line). It becomes the first thing on page one. (to do) - Keep very wide tables to 4 or 5 columns. Wide tables shrink or split on paper. (to do)
- Check links. On paper they're just underlined words, so write out any address people need. (to do)
- Look at the last page. A single orphan line is a sign to trim a paragraph. (to do)
Should I keep the .md file after I make the PDF?
Yes, keep the .md file as your working copy and treat the PDF as a snapshot. Your AI can read and update the .md. It can't do much with a PDF. If you need a change next week, edit the .md and export again.
If the person needs to edit it rather than read it, send Word instead. See how to turn a .md file into a Word document. For which format to send to whom, and how to keep dated copies from getting mixed up, see how to send a .md file to someone who's never seen one.
Questions people ask
Can a Mac turn Markdown into a PDF without extra apps?
Only as plain text. Any app can save a PDF through File › Print, but TextEdit shows a .md file with all its # and ** symbols, so the PDF shows them too. You need an app that formats Markdown first.
What's the free way to turn a .md file into a PDF on a Mac?
VS Code with the free Markdown PDF extension is the easiest free route, and it keeps Mermaid diagrams. Pandoc is also free but needs Terminal and a separate PDF engine such as BasicTeX.
Why do my diagrams show as code in the PDF?
Diagrams show as code in a PDF when the tool you used doesn't draw Mermaid diagrams. Pandoc is the usual cause. Use One Clear Reader, Typora or VS Code with the Markdown PDF extension, which all draw the diagram before saving.
Can people copy text from a PDF made from a .md file?
Yes. One Clear Reader's Save as PDF keeps the text selectable, and so do the VS Code, Typora and Pandoc routes, so the person you send it to can search it and copy from it.
What page size does One Clear Reader use for PDFs?
One Clear Reader saves PDFs on A4 pages. If you print on US Letter paper, choose Scale to Fit in Preview's print dialog so nothing gets cut off.
Is it safe to use an online Markdown to PDF converter?
It works, but you upload the file to someone else's server. For anything private, use a tool that runs on your Mac: One Clear Reader, VS Code, Typora and Pandoc all convert locally.