Home/Blog/How to Convert Markdown to PDF or Word on Mac

How to Convert Markdown to PDF or Word on Mac

Quick answer

The easiest way to convert markdown to PDF or Word on Mac is to export from a markdown app such as atiea, which exports to PDF, DOCX, HTML and Markdown. Alternatively use the command-line tool Pandoc.

You wrote in markdown and now someone wants a PDF or a Word document. There are three practical routes on a Mac: export from a markdown app, run Pandoc, or print a rendered preview to PDF. This guide shows each, with commands you can copy, and covers the problems that usually come up.

Option 1: Export from a markdown app

The simplest route is a notes app with built-in export. atiea exports a note to Markdown, HTML, PDF and DOCX, so you can write in plain text and send a finished file when needed. There is no command line and no extra software to install.

A good habit is to read the rendered preview first. If the preview looks right, the export will generally match it, so you catch broken tables or missing images before the file leaves your Mac. atiea is a native macOS 15+ app, and its markdown editor shows live highlighting as you write.

Option 2: Pandoc

Pandoc is a free, open-source command-line converter that handles many formats. If you use Homebrew, install it with:

brew install pandoc

Then convert a file:

pandoc note.md -o note.docx
pandoc note.md -s -o note.html
pandoc note.md -o note.pdf

Pandoc picks the output format from the file extension. The -s flag (standalone) produces a complete HTML page rather than a fragment. The PDF command only works if a PDF engine is installed; by default Pandoc uses LaTeX, so you need a LaTeX distribution such as MacTeX or BasicTeX, or you can choose another engine:

pandoc note.md --pdf-engine=weasyprint -o note.pdf

That requires the named engine to be installed separately. If you do not already have one, the other two options are quicker for a one-off PDF.

Useful Pandoc options

GoalCommand
Add a table of contentspandoc note.md --toc -s -o note.html
Treat input as GitHub-style markdownpandoc -f gfm note.md -o note.docx
Combine several files into onepandoc intro.md body.md -o report.docx
Use your own Word stylespandoc note.md --reference-doc=template.docx -o note.docx

Convert a whole folder

for f in *.md; do
  pandoc "$f" -o "${f%.md}.docx"
done

This creates a DOCX next to every MD file in the current folder. Quote "$f" so filenames with spaces work.

Custom Word styling

Pandoc lets you supply a reference document so the output uses your fonts and heading styles. Generate Pandoc’s default one, edit its styles in Word, and reuse it:

pandoc -o custom-reference.docx --print-default-data-file reference.docx
pandoc note.md --reference-doc=custom-reference.docx -o note.docx

Edit only the styles (Heading 1, Normal, and so on), not the body text, in that reference file.

Option 3: Preview and print to PDF

Open a rendered preview of your note, choose Print (Cmd+P), then open the PDF menu in the lower left of the print dialog and choose Save as PDF. This works in any Mac app that can print, which makes it the fallback when nothing else is installed. Exact print options vary by app.

Which should you use?

SituationBest option
One-off share with a colleagueExport from your notes app
Batch converting many filesPandoc
Custom fonts and Word stylesPandoc with a reference document
No extra softwarePrint to PDF
Web page or email-ready markupHTML export

Tips for clean output

  • Use real headings (#) so Word gets proper heading styles and a usable outline.
  • Keep tables simple, with short cells; see markdown tables.
  • Leave a blank line before lists and tables, or they may not render.
  • Use a single # title per note and ## for sections.
  • Check the preview before exporting, and open the result once before sending it.

Troubleshooting

  • Pandoc says it cannot find a PDF engine. Install a LaTeX distribution or pass --pdf-engine with an engine you have installed.
  • Task lists show as plain brackets. Task list support depends on the converter and markdown flavor. Try -f gfm in Pandoc, or check how your checklists render in the app preview.
  • Images are missing. Image paths are resolved relative to where you run the command, so run Pandoc from the note’s folder, or use full paths.
  • Wiki links appear as literal text. [[Note title]] is a notes-app convention, not core markdown, so converters like Pandoc may leave the brackets as they are. Replace them with normal links or plain text before converting if that matters.
  • Word formatting looks plain. Pandoc’s default styling is basic. Use a reference document.

When not to convert

If the recipient only needs to read the content, a PDF is usually best. If they need to edit, send DOCX. If they are comfortable with plain text, just send the MD file; see what an MD file is for how they can open it. And for pixel-precise layouts such as brochures, design in a layout tool rather than converting from markdown.

New to the syntax? Start with the markdown cheat sheet or read how to take notes in markdown. To compare apps by export support and other features, see the best markdown notes apps for Mac, and check each product’s site for current details.

Worked example: a report from three notes

Say you keep a project report as three notes: intro.md, findings.md and next-steps.md. To produce one Word file with a table of contents, copy the three files into one folder and run:

cd ~/Documents/report
pandoc intro.md findings.md next-steps.md --toc -o report.docx

Pandoc joins the files in the order you list them, so name them in reading order. Each file should start with its own # or ## heading. Open the result in Word, check the heading levels in the navigation pane, and adjust styles if you need to.

If you only have one note and no command line experience, the app route is shorter: open the note in atiea, check the preview, and export to DOCX or PDF.

PDF or DOCX or HTML?

FormatChoose it whenWatch out for
PDFThe reader only needs to read or printHard to edit afterward
DOCXThe reader will edit or comment in WordStyling may need touch-ups
HTMLYou want a web page or to paste into another toolImages need to travel with the file
MarkdownThe reader already uses markdownNot readable as a document for everyone

Whichever you choose, keep the original markdown note. It stays small, editable and easy to reconvert later. If privacy matters for what you are exporting, atiea keeps notes local on your Mac; see the private, local-first notes app guide.

Frequently asked questions

How do I convert markdown to PDF on a Mac?

Export from a markdown app that supports PDF, such as atiea, or open a rendered preview and use Print, then Save as PDF. Pandoc can also make PDFs but needs a PDF engine installed.

How do I convert markdown to Word?

Export to DOCX from an app that supports it, such as atiea, or use Pandoc with the command pandoc note.md -o note.docx.

Does Pandoc need anything extra to make PDFs?

Yes. Pandoc relies on a PDF engine, by default LaTeX, so you need a LaTeX distribution or another engine selected with --pdf-engine.

How do I convert many markdown files at once?

Use Pandoc in a shell loop, for example: for f in *.md; do pandoc "$f" -o "${f%.md}.docx"; done.

Can I control fonts and styles in the Word file?

With Pandoc, yes: pass a styled Word file using --reference-doc. Exporting from an app is faster but gives you less control over styling.

Why do my images or wiki links disappear after converting?

Image paths are resolved relative to where you run the converter, and [[wiki links]] are a notes-app convention that general converters may not understand. Fix the paths and swap wiki links for normal links first.

Start writing something calm.

A native Mac app for markdown notes.

We will email you a TestFlight invitation. No spam, and you can unsubscribe any time.