CruxDevCruxDev Tools Studio Prompts
file Utility • Zero-Server Privacy • 100% Client-Side

Markdown to PDF Converter

Convert Markdown or a GitHub README to PDF with code highlighting, Mermaid diagrams, math, page size, margins and a table of contents.

Overview

Turns Markdown, including a GitHub README, into a print-ready PDF in your browser. It supports GitHub Flavored Markdown tables and task lists, highlighted code blocks, KaTeX math and Mermaid diagrams, with a choice of GitHub, Academic or Minimal paper themes, page sizes, margins, a table of contents and page numbers. Your text is rendered locally and never uploaded.

How It Works

Paste Markdown into the editor, or drop a .md, .markdown or .txt file of up to 5 MB, and the white paper preview updates as you type. Pick a theme, a page size of A4, Letter, Legal or A5, portrait or landscape, narrow, normal or wide margins and a base font size from 10 to 16 pt. Toggles add a table of contents, page numbers, header text, a page break before each H1 and rules that keep code, tables and images from splitting. Save as PDF opens the print dialog; the quick download, .html and .md exports are one click each.

Step-by-Step Usage Guide

  1. Paste your Markdown or drop a README.md file into the editor.
  2. Choose a paper theme, page size, orientation, margins and base font size.
  3. Turn on a table of contents, page numbers, header text or H1 page breaks if you want them.
  4. Check the preview, especially Mermaid diagrams and long tables, for errors or awkward breaks.
  5. Click Save as PDF, then pick Save as PDF as the destination in the print dialog.

Technical Specifications & Standards

The preview is the single source of truth for every export. Its rendered HTML, with Mermaid diagrams already converted to SVG, is wrapped in a standalone document with the theme CSS and @page rules for size, orientation and margins, then printed from a hidden frame. Choosing Save as PDF in that dialog lets the browser write the PDF, so text stays selectable and searchable and links remain clickable. The header text and the Page X of Y footer use CSS margin boxes, which Chrome and Edge draw; Firefox ignores them and simply prints without. The quick download uses html2pdf, which photographs the page with html2canvas, so that file is image-based and its text cannot be selected. Math is lifted out before parsing so underscores in TeX are not read as emphasis, and the inline rule follows Pandoc, which keeps $5 and $10 as currency rather than a formula. Fenced code is highlighted with highlight.js for common languages such as JavaScript, TypeScript, Python, Go, Rust, SQL, YAML and Bash, and a ```mermaid fence becomes a diagram rendered by Mermaid in strict mode. Raw HTML inside the Markdown is shown as text rather than executed, so a pasted file cannot run script. Your document and settings are saved to this browser's local storage and restored next time.

Targeted Use Cases

  • Sharing a GitHub README as a PDF with reviewers who do not use GitHub.
  • Printing technical documentation that mixes code samples, tables and Mermaid architecture diagrams.
  • Producing lecture notes or a short paper with KaTeX equations in the Academic theme.
  • Exporting a standalone .html copy of Markdown notes for archiving or emailing.
  • Attaching a formatted changelog or runbook to a ticket as a PDF.

Notes & Gotchas

  • Use Save as PDF through the print dialog for anything people will search or copy from, and keep the quick download for previews.
  • Print from Chrome or Edge if you need the header text and page numbers in the page margins.
  • Leave the avoid-break rules on so code blocks and diagrams are not cut across two pages.
  • Switch off headers and footers in the print dialog's own settings, otherwise the browser adds its URL and date as well.

Frequently Asked Questions

How do I convert a GitHub README to PDF?

Copy the raw README text or drop the README.md file into the editor, keep the GitHub theme, then click Save as PDF and choose Save as PDF in the print dialog. Tables, task lists and fenced code render the way they do on GitHub.

Does it support Mermaid diagrams in the PDF?

Yes. A fenced block marked mermaid is rendered as an SVG diagram in the preview, and that SVG is embedded in the printed document, so diagrams stay sharp at any zoom. A syntax error shows the Mermaid message in place of the diagram.

Will the text in my PDF be selectable?

With Save as PDF through the print dialog, yes: the browser writes real text and links. The Quick download button builds an image of each page instead, so its text cannot be selected or searched.

Why are there no page numbers in my PDF?

Page numbers and header text use CSS page margin boxes, which recent Chrome and Edge support. Firefox and some other browsers skip them, so print from Chrome or Edge, and check that Page numbers is switched on.

Can I use HTML tags inside the Markdown?

Raw HTML is escaped and shown as text rather than rendered, for safety. Use Markdown syntax for images, links, tables and emphasis; tags such as details or custom divs will appear literally.

Related tools

  • Add Page Numbers to PDF - Stamp page numbers on a PDF in formats like "Page 1 of 9" or roman numerals, with position, size, margin and start number.
  • PDF to Word (DOCX) - Convert a PDF into an editable Word .docx file in your browser, with headings detected by font size, one section per page, and an exact-layout option that places each page as an image.
  • Word to HTML / Markdown - Convert a Word .docx file to clean HTML and GitHub Markdown with headings, lists, tables and links kept, and images embedded as base64 or exported as separate files in a ZIP.
  • HTML to PDF - Paste HTML or load an .html file, preview it on a real page size, and export a PDF with your choice of paper, orientation and margins. Scripts and event handlers are removed first.
  • PDF N-up (Pages per Sheet) - Print 2, 4, 6, 8, 9 or 16 PDF pages on each sheet, on A4, Letter, Legal, A3 or A5, with page order, margins, gaps and thin borders. Pages stay vector, so text remains sharp.
  • Markdown to Word (DOCX) Converter - Convert Markdown or a GitHub README into an editable Word .docx with real headings, numbered and nested lists, bordered tables, code blocks, links and embedded images, built in your browser.