Convert MD to PDF

Converting MD to PDF turns a Markdown file into a finished document anybody can open and print, but not a rendered one: the engine behind this pair has no Markdown reader, so the hashes in front of a heading and the asterisks around a word are printed rather than obeyed. Drop the file above — it is converted on our server and deleted as soon as the job finishes.

  • Where it runs On our server, because a browser cannot run the software this needs.
  • Rebuilt PDF works differently from an MD, so this is not the gradual degradation a lossy codec applies. What PDF can express is reproduced faithfully; what it has no equivalent for does not survive at all.
  • File size limit Up to 25 MB per file, free, without an account.
  • Worth knowing Layout is reproduced with metric-compatible substitute fonts. Macros, comments and tracked changes are not carried over.

Up to 100 files at once. Mixed formats are fine.

Markdown has no page, so the converter supplies one

This is the difference from every other document conversion on the site. A Word file knows its page size, its margins and its fonts; a Markdown file knows none of those, because the format deliberately records structure and leaves appearance to whatever renders it.

So every decision about the page — its size, its margins, the typeface, where a break falls — is made by the converter, and none of them is in your file. That is the trade Markdown makes, and it is usually a good one: the same document becomes a web page, a slide deck and a PDF without being rewritten. The cost turns up here, because a converter that has not been told how to read Markdown has nothing to render and falls back to setting the characters.

The markup is printed, not rendered

Every character of the file arrives on the page, in order, in one typeface. A line reading ## Requirements is set as ## Requirements. A bullet written with a hyphen is a line beginning with a hyphen. A fenced block still carries its three backticks above and below. Bold keeps its four asterisks. Nothing is dropped and nothing is interpreted, because the document engine behind this pair reads text and has never been given a Markdown filter.

What that leaves is worth being precise about. Line breaks, blank lines and indentation are preserved exactly, so a document whose value is its commands and its configuration converts to something usable. A document whose value is its heading hierarchy does not, and the answer there is to render the Markdown in the tool you wrote it in — an editor preview, a static-site build, a documentation pipeline — and print the PDF from that. This conversion is for fixing the text of a file, not for typesetting it.

The images are not in the file

A Markdown document showing six diagrams contains no diagrams. It contains six paths, and the pictures live beside it on disk or on a server. This surprises people converting for the first time, and it is the commonest reason a PDF arrives with gaps.

The fix is to make the paths resolve before converting. Relative paths have to point at files that actually accompany the document; absolute web addresses depend on that server being reachable. If the images are the point of the document, this is the step to get right rather than the conversion settings.

Front matter is not Markdown

A great many Markdown files open with a block fenced by three hyphens containing a title, a date and some tags. Static-site generators, documentation builders and note applications read that as metadata and remove it before rendering anything.

This conversion does not know the convention and prints the block like everything else, so the PDF begins with three hyphens and a list of key-value pairs before the document starts. Deleting the block before converting is the whole fix, and it is worth doing on a copy so the original keeps working in whatever tool wrote it.

Why the flavour of your Markdown makes no difference here

The original description of Markdown from 2004 was informal, CommonMark is the precise specification most tools follow, and the pipe tables, task lists, footnotes and strikethrough everybody uses are extensions on top of it. Which of those a tool implements is normally the question that decides how a document comes out.

It is not the question on this page. Nothing here implements any of them, or the core either, so a GitHub table and a CommonMark heading are treated identically — as lines of text. That is at least predictable: there is no flavour to guess at and no renderer to test against, and what you see in your editor with syntax highlighting off is what the PDF will contain.

Why convert at all when the Markdown is readable

Because the audience is not you. A client, a lawyer, a committee or a compliance officer wants a document they can open, print, sign around and file — not a file their machine offers to open in a code editor, and not a repository they have to navigate. The hashes travel with it, so this is a fixed copy rather than a presentable one.

A PDF also freezes the state. A README changes every week; a PDF of it is what was true on the day it was attached to something, which is exactly what a review, a submission or a contract annex needs. Keep writing in Markdown and export at the moment somebody outside needs a copy.

When HTML or DOCX is the better target

HTML when the destination is a web page or a documentation site, since Markdown was designed as a shorthand for it and the conversion is closer to a translation than a rendering.

DOCX in one specific and common situation: the recipient will only accept a Word file, and wants to add tracked changes. Markdown has no review workflow at all, so a document going into a round of comments is better handed over as DOCX and read back afterwards — and PDF is for the version that is finished. That target runs through the same engine, so the markup arrives in the Word file as text too; the difference is that the reviewer can fix a heading and you cannot fix one in a PDF.

How to convert a Markdown file to PDF

  1. Decide whether you need the markup rendered; if you do, print from your editor instead of converting here.
  2. Delete any front matter block at the top — it prints with the rest — then drop the file onto this page.
  3. Download the PDF; the uploaded file is deleted straight away.

MD and PDF: structure meets a fixed page

MD compared with PDF
MDPDF
Full nameMarkdownPortable Document Format
File extension.md, .markdown.pdf
Media typetext/markdownapplication/pdf
CompressionEither, depending on the setting
First published20041993
Published byAdobe
SpecificationCommonMarkISO 32000-2
LicensingOpen standardOpen standard
Standing todayCurrentCurrent
Colour it can describeRGB, CMYK, greyscale
Opens in a browserNo browserEvery browser
Considered insteadHTML, TXT, DOCXDOCX, HTML

Opening the result

PDF opens in every current browser. MD has narrower browser support than that. If the file is going onto a web page or into a form, that is usually the whole reason for the conversion.

The usual programs do not overlap: MD opens in Visual Studio Code, Obsidian and Typora, PDF in Adobe Acrobat, Preview and LibreOffice Draw — so whoever receives the result needs something from the second list.

What each format is for

The two are aimed at different work: MD at editing and moving data between programs, PDF at handing a finished file over, print and archiving. That is worth weighing before converting, because the reason one exists is usually the reason the other is awkward.

MD was published in 2004. The specification is CommonMark, and it is worth reading if the file has to outlive the tool that wrote it.

PDF comes from Adobe and dates from 1993, specified as ISO 32000-2. Adobe Acrobat, Preview and LibreOffice Draw all read it.

MD to PDF: markup, images and front matter

Are my MD files uploaded anywhere?

Yes — this conversion needs software that cannot run in a browser, so the file is uploaded over an encrypted connection. It is deleted as soon as the job finishes, and the result is sent straight back to you without being stored. The work is done by LibreOffice, the full office suite, running headless.

Why are my images missing?

A Markdown file contains paths, not pictures, and nothing here follows a path. The image reference is printed as it was written — an exclamation mark, the alt text in square brackets, the path in round ones — so the PDF carries the reference rather than the picture. If the diagrams are the point of the document, render the Markdown in the tool you wrote it in and print from there.

What are the three hyphens at the top of my PDF?

Front matter — a YAML block that static-site generators and note applications read as metadata and strip before rendering. It is not Markdown, so a converter that does not know about it prints it. Delete the block before converting.

Do tables survive?

The characters do; the table does not. A pipe-delimited table arrives as the rows of pipes and hyphens you typed, one line each, in the same typeface as everything else. Pipe tables are a GitHub extension rather than part of CommonMark, but that is not the reason here — nothing in this conversion reads Markdown at all.

Do code blocks keep their formatting?

They keep their line breaks and their indentation, which is what matters for anything anyone will retype, and they keep their three backticks above and below as well. What they do not keep is any distinction from the prose around them — no box, no shading, and no syntax colouring, which is added by a renderer rather than stored in the file.

Can I control the page size and margins?

Not from the Markdown, because the format has no way to express either — it describes structure and leaves appearance entirely to whatever renders it. The converter supplies a sensible page, and anything more particular needs a tool built for typesetting.

Does the file get uploaded?

Yes, this one runs on a server rather than in the browser, because it needs a real document engine. The file travels over an encrypted connection, is converted in an isolated environment with no route out to the internet, and is deleted as soon as the job finishes.

More about these formats

Where these figures come from

The claims this page makes about MD and PDF are checkable, and these are the documents that settle them.