You’ve written a document in Markdown and now you need to send it as a PDF — a format that looks the same everywhere and prints cleanly. This guide shows the simplest way to turn any Markdown file into a professional PDF, with full control over headers, footers, page numbers and margins.
New to the format? The complete Markdown guide covers the syntax; this article is about getting a great PDF out the other end.
The simplest method: a Markdown editor with export
The most reliable way to get a good-looking PDF is to write (or open) your file in a Markdown editor that renders a live preview and exports directly. The advantage is what you see is what you get: the PDF matches the formatted preview exactly — the same theme, fonts, tables and code blocks — so there are no surprises.
Here’s the flow in Inkiostro on Mac, iPad or iPhone:
- Open or paste your Markdown. Any
.mdfile works, or start writing from scratch. - Switch to the live preview to see the document fully rendered — headings, lists, tables, images and code all formatted.
- Choose Export → PDF.
- Fine-tune the page. Set a title, add a header and footer, turn on page numbers, and adjust the margins to taste.
- Export and share — save the file, or send it straight to Mail, Messages or AirDrop.
Because the PDF inherits your chosen reading theme and font, you can produce anything from a clean, minimal document to a warm, book-like page — without touching a layout tool.
What a good Markdown-to-PDF export should handle
Not all conversions are equal. A quality export preserves everything your Markdown expresses:
- Headings and structure, so the document reads as an outline.
- Tables rendered cleanly, not as raw pipes.
- Code blocks with monospaced formatting (and syntax highlighting).
- Images embedded at the right size.
- Links kept clickable in the PDF.
- Math and diagrams, if your document uses them — see LaTeX math in Markdown and diagrams from plain text.
Customizing the page layout
For a document that looks intentional rather than dumped-to-PDF, control the page itself:
- Title — a document title on the first page.
- Header and footer — repeated text (like the title or your name) at the top and bottom.
- Page numbers — essential for anything more than a page or two.
- Margins — tighten or loosen the whitespace around the text.
In Inkiostro these are all options in the PDF export dialog, so you set them once and get a consistent, polished result every time.
Other ways to convert Markdown to PDF
- Command line (Pandoc). Developers can run a tool like Pandoc to batch-convert files. It’s powerful but requires installation and setup, and getting the styling right takes effort.
- Print to PDF from a browser. If your editor exports HTML, you can open it and “Print → Save as PDF.” It works, but you get less control over headers, margins and page breaks.
For most people, exporting straight from a Markdown editor is faster, looks better, and keeps the result identical to the preview.
Tips for a cleaner PDF
- Preview first. Fix any formatting quirks in the rendered view before exporting.
- Use one
#heading as the document title, then##and###for structure — it makes the PDF’s hierarchy clear. - Add alt text to images and check they’re not oversized.
- Pick a reading theme that suits the audience — minimal for reports, warmer for prose.
Ready to try it? Inkiostro exports to PDF, HTML, TXT and Markdown (plus EPUB on Mac) — free, with no account and no watermarks. See why it’s a great Markdown editor for Mac.
FAQ
How do I convert a Markdown file to PDF?
Open the .md file in a Markdown editor with PDF export, switch to the live preview to check the formatting, then choose Export → PDF and set your headers, footers, page numbers and margins. Inkiostro does this on Mac, iPad and iPhone.
Will the PDF look exactly like my preview?
With a good editor, yes. Inkiostro’s PDF matches the live preview — the same theme, font, tables and code formatting — so the exported document is exactly what you saw on screen.
Can I add page numbers and headers to a Markdown PDF?
Yes. In Inkiostro’s PDF export you can set a title, add a header and footer, enable page numbers and adjust the margins before exporting.
Can I convert Markdown to PDF for free?
Yes. Inkiostro exports to PDF for free, with no account required and no watermark on the output.
Does Markdown-to-PDF keep my tables, code and images?
A quality export preserves all of them — tables render cleanly, code blocks stay monospaced with highlighting, and images are embedded. Math equations and diagrams are kept too if your editor supports them.