Markdown to PDF
Convert Markdown files into formatted PDFs.
120 characters
How to use Markdown to PDF
What is Markdown?
Markdown is a lightweight plain-text formatting syntax invented by John
Gruber in 2004. It uses small pieces of punctuation — # for headings,
* for emphasis, - for bullets, backticks for code — to mark up a
document while keeping it perfectly readable as raw text. Because the
source is just text, Markdown files survive every editor change, every
operating-system upgrade and every cloud-sync hiccup. It is what
README files are written in, what static-site generators consume, what
many note-taking apps store on disk, and what most developer-facing
documentation systems expect.
What is a PDF?
A PDF (Portable Document Format) is a self-contained document file created by Adobe in the early 1990s and now an open ISO standard. Where a Markdown file describes a document in raw text, a PDF carries the finished, laid-out version — paper size, page breaks, fonts, margins and all. When you want a piece of writing to look identical on every device, print cleanly and be acceptable as a formal upload, PDF is the format you hand someone.
Why convert Markdown to PDF?
The most common reason is sharing with people who do not read raw Markdown. A README looks pleasant on GitHub but is a wall of punctuation in any plain text reader. Converting once gives you a formatted document anyone can open in Acrobat, Preview or a browser tab without thinking about it.
The next reason is submission requirements. Universities, employers, grant applications, conference review systems and most government forms only accept PDF. If you write your essays, reports or proposals in Markdown — which many people now do — you need a clean one-step conversion that keeps headings, lists and emphasis intact.
The third reason is printing. Markdown source has no concept of a page; PDF lets you pick paper size and orientation up front, so your printout looks like a finished document rather than a code listing.
The fourth reason is archival. A Markdown note, a meeting brief or a long-form blog draft is easier to attach to an email, file in a document store or hand to a non-technical colleague when it is a PDF.
How to use this Markdown to PDF converter
- Type or paste your Markdown into the Markdown box, or drop a
.mdor.markdownfile onto the dropzone above it. The file is read locally — only its text content is loaded into the browser. - Pick a paper size — A4 if you are in Europe, India or most of the world, US Letter in the United States and Canada, US Legal for taller pages.
- Pick an orientation — portrait for normal prose, landscape if your document contains wide tables or long code blocks.
- Optionally edit the filename — the result downloads as
your-name.pdf. - Click Convert to PDF. The conversion runs in your browser:
markedparses the Markdown to HTML, then pdf-lib lays it out onto the PDF page. The download starts when it is finished.
Quality tips for Markdown to PDF
The body font is Helvetica from pdf-lib’s standard fonts, with Courier
for code. If you have written your Markdown in a markdown-aware editor,
it will already look polished — but a few small habits make the PDF
read better. Keep paragraphs separated by a blank line; the converter
treats blank lines as paragraph breaks. Use ## and ### for
sub-sections rather than bolding the line by hand — heading levels are
rendered at distinct sizes. If you have long code blocks, switch to
landscape and they will fit without wrapping.
For tables, prefer compact column headings — pdf-lib draws table cells at the column widths the HTML implies, and very wide tables overflow the page. If a table is genuinely large, use the CSV to PDF tool, which lays out tables natively and handles page breaks for you.
Privacy
Your Markdown and any file you drop never leave your browser tab. The
conversion happens in JavaScript on your device using the marked
parser and the pdf-lib library, both of which are loaded once from
this site and then cached. After the page has loaded there are zero
network requests during conversion — you can verify this in your
browser’s Network panel, or simply turn off Wi-Fi before clicking
Convert to PDF.
Browser compatibility
The output is a real PDF 1.7 file with text embedded as Helvetica and Courier — both members of the 14 PDF standard fonts every reader ships with. It opens identically in Adobe Acrobat, Apple Preview, the built-in PDF viewers in Chrome, Edge, Firefox and Safari, mobile readers on iOS and Android, and on every mainstream Linux distribution. There is no font subsetting and no encryption, so the file is also indexed cleanly by file managers and document search tools.
Frequently asked questions
How are Markdown headings, lists and links rendered in the PDF?
marked library to get clean HTML, then lays it out in the PDF using pdf-lib. Headings come through at scaled sizes (h1 largest, h6 smallest), bullet and numbered lists keep their indentation, links are written as underlined text with the URL preserved, and inline emphasis like bold and italic picks the right Helvetica weight. The result is a real text PDF — selectable, searchable, and well under 200 KB for most documents.Do fenced code blocks keep their monospaced formatting?
code spans inside paragraphs also switch to the monospaced font. Syntax-highlight colours are not applied (the standard PDF fonts do not include a colourised theme), but indentation, symbols and line breaks are exact.Does the converter follow GFM or CommonMark?
marked in its default configuration, which is CommonMark-compliant with the most common GitHub Flavored Markdown extensions enabled — fenced code blocks, tables, strikethrough and task lists all work. Obscure GFM-only features like footnote references or HTML embeds inside lists may render as plain text. If something looks off, simplify the construct and re-run.Can I embed images in the Markdown?
data: URIs are not currently inlined, and remote https:// images are skipped to keep the conversion fully offline. If you need an image in the output, use the HTML to PDF tool instead — that pipeline renders via html2canvas and will include images that load successfully in your browser tab.Is my Markdown sent to a server?
marked and pdf-lib run inside your browser tab. The Markdown you paste, and any .md file you drop, are read into memory and converted locally — there is no network upload. You can confirm this in the browser's Network panel, or switch off Wi-Fi after the page has loaded and the converter will still work.Related tools
TXT to PDF
Convert plain text files to searchable PDFs in your browser.
HTML to PDF
Convert HTML pages into print-ready PDFs.
Markdown to HTML
Convert Markdown into HTML.
PDF Merger
Combine multiple PDF files into one document.
PDF Compressor
Reduce PDF file size for easier sharing.
Word to PDF
Convert DOCX Word documents into PDFs.