How to convert Markdown to PDF

Markdly is a Markdown editor built for people who convert Markdown to PDF often, on a computer and on a phone. Open the .md file and export it as a PDF from the app's menu: the PDF is made on your device, with Mermaid diagrams and math drawn. PDF export is in the Mac, Windows, Linux, iPhone, iPad and Android apps. It's a paid app with a sign-in.

  • Nothing else to install: the diagram and math engines are inside the app.
  • Page breaks: you decide where a new page starts.
  • On a Mac: the PDF takes your theme and your own CSS.

$19.99 once, no subscription.

Four ways to convert Markdown to PDF

  • Free

    Pandoc

    Cost
    Free
    Good for
    Anyone at home in a terminal. The manual's own example is one line: pandoc test.txt -o test.pdf.
    The catch
    Its default route needs a LaTeX engine installed first. The other engines it can use are each one more thing to set up.

    Pandoc User's Guide: Creating a PDF

  • Free

    VS Code with the Markdown PDF extension

    Cost
    Free
    Good for
    People who already write in VS Code: the extension adds Export (pdf) to the Command Palette, and makes HTML, PNG and JPEG files as well.
    The catch
    It isn't Microsoft's, and Microsoft's Markdown page describes no PDF feature of its own. The extension drives Chrome, Edge or Chromium, downloading one on first use if none is installed, and by default it loads Mermaid from a CDN, so diagrams need a connection.

    Visual Studio Marketplace: Markdown PDF, by yzane

  • Free

    A website: Dillinger or GitHub

    Cost
    Free
    Good for
    A one-off. Dillinger is a free online editor that turns what you paste into a PDF with one click. GitHub shows a repository's .md file formatted, and your browser's Print saves that page as a PDF.
    The catch
    Your text goes into a web page first. Dillinger says drafts are kept by your browser in its local storage; read a site's privacy terms before you paste a private document. GitHub formats only files that are in a repository.

    Dillinger: Online Markdown Editor with Live Preview

  • Our app

    Markdly

    Cost
    $19.99 once, or every premium Bravely utility for $95.99/yr or $399 once
    Good for
    People who make PDFs from Markdown often: you export from the app's menu, on a computer and on a phone.
    The catch
    It's a paid app with a sign-in, and the page layout has few settings: the list is below.

How to convert Markdown to PDF with Markdly

  1. Open the file

    Get Markdly for your device and sign in with your Bravely Account. Then open the .md file. Markdly works on the file where it already is: nothing is imported and no copy is made.

  2. Place page breaks, if you want them

    Put the cursor where a new page should start and press the Page break button on the formatting toolbar. On a Mac it's also Format > Page Break. A break starts a new page in the PDF and when you print.

  3. Export the PDF

    Mac: File > Export PDF...

    Windows: File > Export PDF…, or Export… (Ctrl+E) and then PDF.

    Linux: open the menu, choose Export… (Ctrl+E), then PDF (.pdf).

    iPhone and iPad: open the … menu on the document, then Export, then PDF.

    Android: tap More actions, then Export, then PDF.

  4. Save the PDF

    On a computer, pick a name and a folder in the save dialog. On a phone the PDF is made first; then the share sheet on an iPhone or iPad, or the save picker on Android, asks where it should go.

    On an Android that won't write the PDF directly, Markdly opens the print dialog instead, where Save as PDF makes the file.

When a free way is the better choice

Pick Pandoc when the PDF is part of a build. It runs from a script, its manual has a --toc option for a table of contents, and LaTeX sets the type. Markdly's menu does none of that.

Stay in VS Code if that's where the file already is: the extension saves you a second app.

For one README, GitHub and Print are enough. On a Mac, Apple's steps are File > Print, then the PDF button. Chrome's print window (Ctrl+P, or ⌘P on a Mac) has Save as PDF.

Markdly earns its price when you do this often, on more than one device, or with diagrams you want drawn while the network is off.

Diagrams and math in the PDF

A Mermaid code block is drawn as its diagram, and LaTeX math written between dollar signs is typeset. Both engines are files inside the app, so they draw with no connection, and Markdly waits for the diagrams to finish before it makes the pages.

The PDF is always a white page with dark text, even when the app is in its dark look. Long code lines wrap on a Mac and on Windows.

The Mermaid diagram editor page covers writing the diagrams themselves.

On a Mac, style the PDF with a theme or your own CSS

Open Settings. Under General, Document Theme offers Default, GitHub and Serif. Under Themes, the Theme menu adds Serif Pro, Mono and Minimal, and Apply custom CSS on top of the preview theme layers your own stylesheet over whichever you picked. Reveal custom.css in Finder shows you the file.

The Mac's PDF is made with all three. Windows and Linux have themes and custom CSS too, but there they shape Visual only, and the PDF is Markdly's standard light page. On iPhone, iPad and Android the PDF takes the theme and text size from the app's settings, and those apps have no custom CSS.

Where your document goes

PDF and HTML are made on your device on every platform. Nothing is uploaded to make them, which is the difference from pasting a private document into a website.

Markdly also makes Word, EPUB, LaTeX and slide files, and those work differently. On Linux they're converted on your computer. On Mac, Windows, iPhone, iPad and Android, Markdly sends the document to Bravely's conversion service, which returns the file and keeps no copy. On a Mac and on Windows the pictures stored beside the document go with it. That needs a connection, and the text can be up to 5 MB. A diagram arrives in those four formats as its code, not as a drawing.

Convert markdown to DOCX has the Word steps.

What Markdly's PDF doesn't do

  • It doesn't number the pages, and it adds no running header, footer or table of contents.
  • There's no paper-size, margin or orientation setting. A PDF from a Mac, an iPhone or an iPad is US Letter. Android picks Letter or A4 by country, and Linux uses your system's default paper.
  • Code blocks aren't colored by language in the PDF. Visual colors them.
  • A Mac PDF holds 400 pages at most. A longer document is refused with a message, never cut short.
  • It converts the document you have open. It doesn't convert a whole folder at once.

FAQs

How do I convert a Markdown file to PDF for free?

Three ways cost nothing: Pandoc from a terminal, the Markdown PDF extension for VS Code, or your browser's Print on a page that shows the file formatted, such as GitHub. Each has a catch, listed in the options above.

Can VS Code export Markdown to PDF?

Not by itself. Microsoft's Markdown page for VS Code covers the preview, which draws math and Mermaid diagrams, and says nothing about PDF. The free Markdown PDF extension, by yzane, adds an Export (pdf) command.

Does Pandoc need LaTeX to make a PDF?

By default, yes. Pandoc's manual says it uses LaTeX to create the PDF, which requires that a LaTeX engine be installed. Its --pdf-engine option lists others, among them wkhtmltopdf, weasyprint and typst.

Can I convert Markdown to PDF without uploading it?

Yes. Pandoc and the VS Code extension run on your computer, and Markdly makes the PDF on the device in your hand. A website is the one way where your text goes into a web page first.

Does Markdly work with no connection?

Visual, diagrams, math and the PDF work with no connection. Signing in needs one, and after a purchase Markdly keeps working for up to 72 hours between checks of your account.

Markdly icon

Markdly

Native markdown editor

$19.99 once, no subscription.