LocalPDFlab

Markdown to PDF converter

Turn .md files into polished PDFs with code highlighting, tables, math, diagrams, and a table of contents. Write or paste Markdown, preview it live, and download. Your text never leaves your device.

No uploadSelectable text and linksNo sign-up

Drop a Markdown file here, or click to choose one

Add the images it uses at the same time. Everything stays on this device.

Files stay on your device
No file?

Enter PDF password

Enter the password to open.

How to convert Markdown to PDF

  1. 1

    Open or paste your Markdown

    Drop a .md file, type in the editor, or paste Markdown from GitHub, Obsidian, Notion, or an AI chat. Add the images it uses at the same time.

  2. 2

    Check the live preview

    The preview updates as you type, with code colors, formulas, diagrams, and tables drawn the way they appear in the PDF.

  3. 3

    Choose the look and page

    Pick a theme and text size, Letter or A4 paper, margins, page numbers, a header, and an optional table of contents.

  4. 4

    Convert and download

    Select Convert to PDF, look over the pages, and download a PDF with selectable text, clickable links, and bookmarks.

Markdown syntax that converts

The converter reads CommonMark with GitHub Flavored Markdown extensions, the same flavor GitHub, GitLab, and most editors use, plus math, diagrams, and page breaks.

ElementMarkdownIn the PDF
Headings# Title, ## SectionStyled headings, PDF bookmarks, and table of contents entries
Emphasis**bold**, *italic*, ~~strike~~Bold, italic, and strikethrough text
Links[text](https://example.com)Clickable web links; [text](#heading) jumps inside the PDF
Lists- item, 1. itemBullets and numbers, nested to any depth
Task lists- [x] done, - [ ] to doDrawn checked and empty boxes
Tables| A | B | with :--: alignmentBordered tables with left, center, and right columns
Code```python fenced blocksSyntax colors for about 35 common languages
Inline code`npm install`Monospaced text on a light background
Quotes and alerts> text, > [!NOTE]Quote bars and colored Note, Tip, Important, Warning, and Caution boxes
Images![alt](photo.png)Images from added files or the web, scaled to fit the page
Footnotestext[^1] and [^1]: noteNumbered notes at the end, linked both ways
Math$E=mc^2$ and $$...$$Typeset formulas drawn by MathJax, including chemistry with \ce{}
Diagrams```mermaid blocksFlowcharts, sequence diagrams, Gantt charts, and more
Page breaks<!-- pagebreak --> or \newpageA new page starts at that point
Contents[TOC] on its own lineA table of contents with page numbers and links
HTML<kbd>, <mark>, <sub>, <details>Inline HTML is kept; scripts never run

Four document themes

GitHub

The familiar README look: clean sans-serif text, underlined section headings, gray code blocks, and striped tables. Good for documentation and project notes.

Academic

Times New Roman style serif text, justified paragraphs, a centered title, and ruled tables in the style of a journal. Good for papers, essays, and reports.

Modern

Calibri style text with blue headings, a bold title rule, and highlighted table headers. Good for proposals, handouts, and business documents.

Compact

Smaller text and tighter spacing that fit more on each page. Good for cheat sheets, long logs, and printing to save paper.

Control the PDF from your Markdown

A YAML front matter block at the top sets the PDF's title, author, and keywords, which PDF readers show in the document properties. A [TOC] line places a table of contents with page numbers, and a page break comment starts a new page. The front matter itself is not printed.

---
title: Quarterly Report
author: Jordan Lee
keywords: [finance, Q3]
---

# Quarterly Report

[TOC]

<!-- pagebreak -->

## Revenue

Math formulas and diagrams

Write formulas in TeX between dollar signs, as you would in Obsidian, Jupyter, or a GitHub README. Display math is centered on its own line. Code blocks marked mermaid become flowcharts, sequence diagrams, Gantt charts, pie charts, and other Mermaid diagrams. Prices such as $5 and $10 are left as text, not mistaken for math.

Inline: $a^2 + b^2 = c^2$

$$
\sum_{k=1}^{n} k = \frac{n(n+1)}{2}
$$

```mermaid
flowchart LR
  Draft --> Review --> Publish
```

Images in your Markdown

Images on the web load as they do on GitHub. For images on your computer, add the files with the Images button or drop them on the editor; each is matched by the name or relative path in your Markdown, so ![Diagram](assets/diagram.png) finds diagram.png. Dropping a picture on the editor also inserts its Markdown for you. Large images shrink to fit the page width and never split across pages.

Markdown from anywhere

GitHub and developer docs

Share a README, changelog, API guide, or design doc as a PDF with highlighted code and working links, for people who never open a repository.

Obsidian, Notion, and notes

Export notes as Markdown and turn them into handouts, study guides, or meeting notes, with formulas and task lists intact.

ChatGPT and AI answers

AI assistants write in Markdown. Paste a long answer, report, or plan and get a clean PDF instead of a screenshot or a messy copy into Word.

Other ways to make a PDF from Markdown

MethodGood atTrade-off
PandocBooks, citations, and LaTeX-quality typesettingNeeds installing Pandoc and a LaTeX system, and command-line use
VS Code extensionsConverting while you codeNeed VS Code and often a separate Chromium download
Browser print previewQuick output from a rendered pageNo bookmarks or contents page; adds the browser's own headers unless turned off
This converterReady-made themes, math, diagrams, contents, bookmarks, on any deviceNo citation processing; fonts limited to five classic families

Private by design

Most online Markdown converters upload your file to a server to render it. Here the Markdown is parsed, laid out, and written into a PDF inside your browser tab, so drafts, internal documentation, and notes stay on your device. Any HTML in your Markdown is shown in a sandbox where scripts cannot run. If you start from a blank editor, your draft is kept in this browser so a closed tab does not lose your work.

More tools for your PDF

For styled web pages and HTML files, use HTML to PDF. For plain text without formatting, Text to PDF is simpler, and documents written in Word convert with Word to PDF. After converting, merge chapters into one file, add a password, or open the result in the PDF Reader to check the bookmarks.

Frequently asked questions

Is my Markdown uploaded anywhere?

No. The Markdown is turned into a PDF by your browser on your device. The file, your images, and the finished PDF are never sent to LocalPDFLab. If your Markdown links to images on the web, your browser fetches those images like any web page would, and you can turn that off in the settings.

Does it support GitHub Flavored Markdown?

Yes. Tables with column alignment, task lists, strikethrough, autolinks, footnotes, fenced code blocks, and GitHub alerts such as > [!NOTE] all convert. Headings get the same link ids GitHub uses, so links like [Setup](#setup) jump to the right page in the PDF.

Can I convert Markdown with math formulas?

Yes. Write TeX between $...$ for inline math and $$...$$ for display math, as in Obsidian, Jupyter, and GitHub. Formulas are typeset with MathJax, and chemistry notation with \ce{} works too. A formula with a mistake is shown as its TeX source so nothing is lost.

Are Mermaid diagrams supported?

Yes. Code blocks marked mermaid become diagrams: flowcharts, sequence, class, state, entity relationship, Gantt, pie, and more. Diagrams are drawn in your browser and placed in the PDF as sharp, high-resolution images.

How do I add a page break?

Put <!-- pagebreak --> on its own line, or use \newpage or \pagebreak as in Pandoc. You can also turn on "Start each top-level heading on a new page" to begin every chapter on a fresh page.

How do I include images that are on my computer?

Add the image files with the Images button, or drop them on the editor. Images are matched by the file name or path your Markdown uses, such as ![Chart](images/chart.png). Images on the web load automatically.

Can I copy text from the PDF?

Yes. The PDF contains real text in embedded fonts, not a picture of the page, so you can select, copy, and search it. Links stay clickable and headings become bookmarks in the PDF reader's sidebar.

Why are emoji missing from my PDF?

The PDF fonts cover Latin, Greek, Cyrillic, and Vietnamese letters, but not emoji or Chinese, Japanese, Korean, Arabic, or Hindi script. Those characters are left out, and the converter tells you how many were skipped.

Which Markdown file types can I open?

Files ending in .md, .markdown, .mdown, .mkd, and .txt, plus R Markdown (.rmd) and Quarto (.qmd) files as plain Markdown. You can also paste Markdown directly into the editor.

Choose another private, browser-based tool for the next step in your document workflow.