Markdown is a lightweight markup language for creating formatted text using a plain-text editor. It very much widespread in technical writing, as one of the main components of the docs-as-code approach.

Since is used for writing a formatted text, a natural question arises: How to convert it to some printable format such as PDF?

This article will discuss this topic considering many different aspects, such as technical knowledge needed, images conversion support or use cases you need for this type of conversion.

The recommended free tools or softwares for coversion from Markdown to PDF are:

  1. Pandoc
  2. CloudConvert
  3. PuzzlesCloud
  4. MarkdowntoPDF
  5. MarkText

The summary of the tools comparison is provided in the table at the end of the article.

Pandoc

Pandoc is a free-software document converter that supports many different conversions. You could take a document in one of the supported formats and convert only its markup to another format. Maintaining the look and feel of the document is not a priority.

One of the many conversion options with Pandoc is also from Markdown to PDF.

NOTE: Pandoc by default uses LaTeX to generate PDF documents. Therefore, you would be required to install a LaTex processor first.

By default, Pandoc uses pdflatex to generate PDF files, which can not handle Unicode characters well.

Examples on how to convert with xelatex and proper Unicode handle:

pandoc --pdf-engine=xelatex input.md -o output.pdf

It could be also used to merge a couple of Markdown documents into a single PDF document:

pandoc --pdf-engine=xelatex input-1.md input-2.md -o output.pdf

Since it is a command line tool, can be used also for document automation, using CICD pipeline and automated workflow. However, be ready to dedicate some development time if you like to bring document look and design to professional level.

This approach gives you also the ability to convert Markdown files with images to PDF.

CloudConvert

CloudConvert is an online free document converter which supports, between many conversions, also Markdown to PDF conversion. If you are a GUI fun, it is probably a good choice for you.

As could be seen on the image below, it supports multiple Markdown flavours: strict, MultiMarkdown, Pandoc and GitHub.

Markdown to PDF conversion - CloudConvert

Unfortunately at the moment of writing this article it is only possible to convert docs one to one, meaning no direct merge possible, however there is a Merge PDF tool on the same website which can be used to combine PDFs, in order of upload. With this approach would be necessary to upload your files twice, first to convert from Markdown to PDF and then to merge PDFs.

Also the author could not find the way to convert Markdown documents with relative or apsolute image paths to PDF on CloudConvert. Images embeded directly into Markdown (base64 encoding) could be converted. Disadvangae is also that PDF styles cannot be modified.

Conversions on the CloudConvert are free of charge, with no registration needed, however there is a daily limit after which you would need to register and pay for conversions.

PuzzlesCloud

PuzzlesCloud is a professional level, cloud and on-premise based, solution that supports between the other features, conversion of Markdown to PDF, but also to DOCX.

On the input side with PuzzlesCloud you could:

  • Import Git repositories with all your Markdown content
  • Upload Markdown files
  • Create new Markdown files
  • Use Markdown editor with productive view (Live preview)
  • Upload docx files that will be converted automatically to Markdown
  • Drag and drop Markdown documents to your Table of Content

On the document with PuzzlesCloud output side you could:

  • Preview your docs any time in final look and design mode
  • Base your documents on fully customized docx template (Markdown to template docx styles are mapped 1:1)
  • Perform versioning of your docs, automatically or manually in 1.0.0 format
  • Publish your output documents to G Drive, website (for Static Sites), or share it by link
  • Leverage Markdown with embedded images (base64) or with relative, absolute, or external image path and convert it to PDF

It supports also API with Webhook service, so that you could laverage full CICD cycle for the documents build.

To try out PuzzlesCloud, it is, at the moment, required to register and you could generate upto 200 pages generated for free. It provides you also Knowledge Base unlimited storage. For the paid version you would get support with corresponding SLAs.

MarkdowntoPDF

MarkdowntoPDF is an GUI based, free online document converter that is specialised for Markdown to PDF conversion.

On the image below you cloud see it’s user interface. After sucessful upload of a Markdown file, your PDF will be automatically downloaded. As it is the case with previous converter tool, it will convert docs, one by one, without an option to merge files. This tool however has possiblity, if you register, to customize PDF styles.

Markdown to PDF conversion - MarkdowntoPDF

It gives you also functionality to create or edit existing Markdown files. Images embeded directly into Markdown (base64 encoding) can be converted.

MarkText

If you are a fun of desktop applications, here is a free option for you. MarkText is a Markdown editor with a feature to export to PDF. One of its unique features that makes it a bit better than other similar tools is you can customize export options for the output PDF file. Options like set paper size, page margins, headings numbering, header and footer customization and adding the table of contents can be used.

As many other open source applications, you could find it on GitHub and even contribute to it’s development.

Markdown to PDF conversion - MarkText

Summary

The table below summarizes all options for all proposed conversion tools, so that your choice could be easier

Feature Pandoc CloudConvert PuzzlesCloud MarkdowntoPDF MarkText
Free conversion
Cloud application x (tool) x (desktop)
Markdown upload x x
Markdown edit and creation x x
Git repo import x x x x
CICD pipeline x x x
PDF styles customization x
DOCX template support x x x
Base64 images encoding support
Relative image path support x x x
Documents merge x ✓ (PDF only) x x
Customer support with SLA ✓ (community only) ✓ (no SLA) x ✓ (community only)

Legend:
x - No support
✓ - Partial support
✅ - Full support

NOTE: Some articles claim that Online Convert also supports conversion from Markdown to PDF. According to our test, it converted Markdown files as pure text, without any markup styles and formats.