iLoveMD
100% in your browser

Convert Markdown to PDF

Render Markdown into a polished PDF document, entirely in your browser. Your files never leave your device.

  • Always free
  • No uploads
  • No sign-up
  • No tracking

← All conversion tools

Drop a Markdown file here or click to upload .md · .markdown · .txt
No files selected

Markdown Input

PDF Preview

Export Your Results

Markdown to PDF Docs

iLoveMD renders Markdown into a real vector PDF — selectable text, native headings, embedded fonts. The renderer is pdfmake, vendored and lazy-loaded on the first export. The PDF Options panel above lets you tune page size, margins, accent color, page numbers, and header / footer text. Mermaid diagrams in your Markdown are rendered as inline images.

PDF Options panel

The options panel above the editor controls the output PDF:

  • Page size: A4 (default), Letter, Legal, A3. Industry standards — pick what your audience prints to.
  • Orientation: Portrait (default) or Landscape. Landscape is useful for wide tables or wide Mermaid diagrams.
  • Margins: Narrow / Normal / Wide. Normal matches Word's default (1 in / 25 mm).
  • Accent color: Default (black headings), Orange, Blue, Green, Purple, Slate. The accent applies to heading color and link underlines — pick one that matches your brand if you're producing a deliverable.
  • Page numbers: off by default. When on, position is bottom-right (default), bottom-center, or top-right.
  • Header / footer text: free text that prints on every page. Supports {page}, {pages}, and {date} tokens (e.g. "Page {page} of {pages}").

Values are validated against a frozen allowlist before they reach pdfmake — that's the security boundary for the page-defaults config.

Mermaid diagrams (new) feature

Fenced code blocks tagged mermaid are rendered as PNG images and embedded inline in the PDF — centered, scaled to fit the page-content width (default ~480 px / 6 in).

\`\`\`mermaid
classDiagram
  class User {
    +String name
    +login()
  }
\`\`\`

The image embeds as a proper PDF Image XObject with DeviceRGB color — viewable in any PDF reader, no extra fonts required. Invalid Mermaid syntax falls back to source as text (no crash, no failed export). See the Mermaid Editor docs for supported diagram types.

Supported Markdown

The full CommonMark feature set plus tables. Specifically:

  • Headings (# to ######) — emit native PDF headings, recognized by every reader's outline pane.
  • Bold / italic / strikethrough — proper character runs.
  • Ordered and unordered lists with arbitrary nesting.
  • Tables with column alignment.
  • Code fences — light-grey background, ZWSP soft-break every 90 codepoints so long lines wrap instead of clipping off the right margin. Multibyte safe (emoji, math symbols, supplementary-plane chars don't cut across surrogate pairs).
  • Blockquotes — orange left-border (slate in dark-accent themes).
  • Links — http/https/mailto. javascript:, file://, UNC, and protocol-relative are rejected at the boundary.

Limits and tradeoffs

Caps tuned for the PDF layout engine, which is more memory-intensive than the DOCX path:

  • Input size cap: ~2 MB of Markdown text. Larger files may render slowly.
  • Nesting cap: 50 levels.
  • Table cell cap: 5,000 cells per document.

Images from ![alt](src) render as plain alt text — fetching the image would mean a network call we deliberately don't make. If you need images in your PDF, embed them in the Markdown via a base64 data URI; pdfmake will pick it up.

Security posture

The renderer itself has had two notable issues we explicitly mitigate:

  • CVE-2026-26801 (SSRF via URLResolver) — we call pdfMake.setUrlAccessPolicy(() => false) immediately after the library loads, denying every URL fetch the renderer might try. No URLs go into the docDefinition.
  • Smoke-grep of the produced PDF for /JavaScript, /OpenAction, /Launch, /EmbeddedFile, and /RichMedia as a final safety check. None of these legitimately appear in our output; if grep finds one, the export fails closed.
  • Header / footer free text is capped at 200 chars and runs the same control-char and trojan-source strip as the body.

Privacy

pdfmake is vendored from this domain, not a CDN. Mermaid rendering (when used) happens locally. No network call leaves your browser at conversion time. The first export downloads the engine (~1 MB) + the Roboto font bundle (~830 KB) — both cached on subsequent exports. Then it works offline.

How to convert Markdown to PDF

1

Paste or drop your Markdown

Paste your Markdown text into the editor, or drop a .md file onto the upload strip.

2

We render it in your browser

iLoveMD builds the PDF locally using JavaScript. Nothing is uploaded to a server.

3

Download your PDF

Click Download and your formatted PDF is saved straight to your device.

Frequently asked questions

Does my Markdown file get uploaded anywhere?

No. The entire conversion runs in your browser using JavaScript. Your file never leaves your device, and we never see its contents.

Is it really free?

Yes, completely free. No sign-up, no watermark, and no file limit beyond what your browser's memory allows.

Which Markdown features are supported?

Headings, bold and italic, ordered and unordered lists, tables, code blocks, blockquotes, and links. Standard CommonMark plus GitHub-flavored tables.

What is the maximum file size?

Up to roughly 2 MB of Markdown text for PDF export. The PDF layout engine is memory-intensive, so larger files may render slowly.

Can I convert a PDF back into Markdown?

Yes. Use the PDF to Markdown tool to extract Markdown from a text-based PDF.