MD to PDF

Turn a README.md into
a document

Export a GitHub or GitLab README to PDF for a review, a client, or an offline copy. Code, tables and headings come through intact — free, watermark-free, no sign-up.

document.md
Source
77 lines · 308 wordsLn 1, Col 1

Getting the Markdown out of GitHub first

Open the README on GitHub and click the Raw button, then copy everything, or download the file and drop it here. Copying from the rendered README page instead will paste the formatted HTML, which loses the Markdown structure — take the raw text.

What carries over from a README

The parts of a README that usually break in other converters are the ones this handles deliberately.

  • Fenced code blocks keep their language highlighting, and long lines wrap rather than running off the page
  • Tables keep their alignment, and a table spanning a page break repeats its header row
  • Task lists render as real tick boxes rather than literal [ ] characters
  • Every heading becomes a PDF bookmark, so a long README stays navigable in a reader's sidebar
  • Anchor links between sections stay clickable inside the PDF

Two things worth knowing about badges and relative links

READMEs lean on two things that only work in context. Badge images are hosted remotely, so they are fetched at conversion time and need to be publicly reachable — a badge behind a private registry will not appear. Relative links such as ./docs/setup.md point at paths inside the repository, so in a PDF they have nothing to resolve against; replace them with absolute URLs first if readers need to follow them.

Making the PDF read like a document

A README is written for a web page, so a couple of switches usually help before exporting. Turn on Title page to promote the project name onto its own page from the front matter or first heading, and Contents to insert a linked table of contents — both are in the style panel. Page numbers are on by default.

Getting the raw file without copying HTML

The single most common mistake is copying from the rendered README page, which pastes formatted HTML and loses the Markdown structure. Take the raw text instead — either through the Raw button, or straight from the command line.

# 1. From the GitHub UI: open the README, click "Raw", select all, copy.

# 2. From the command line, straight to a file:
curl -L -o README.md \
  https://raw.githubusercontent.com/OWNER/REPO/main/README.md

# Note "raw.githubusercontent.com", not "github.com" — the second
# returns the HTML page around the file rather than the file itself.
Two reliable ways to get the actual Markdown rather than the page around it.

Turning a README into something a client will read

A README is written for a repository page, where the project name is in the breadcrumb and the reader already knows what they are looking at. On its own as a PDF it lands without that context. Switching on Title page puts the project name and any front-matter author on their own page, and Contents adds a linked table of contents, which together turn a scrolling web page into something that reads as a document. For an audit or a hand-off, widening the margins is worth doing too — it leaves room for the reader to write in.

Common questions

How do I convert a GitHub README.md to PDF?

Open the README on GitHub, click Raw, copy the text and paste it here — or download the .md file and drag it onto the page. Then click Download PDF.

Will the badges at the top of my README show up?

Yes, provided they are publicly reachable. Badge images are fetched while the PDF is produced, so anything behind a private host or requiring authentication will be missing.

Do relative links inside the README still work?

Links to other files in the repository have nothing to resolve against once the document leaves GitHub. Swap them for absolute URLs before converting if readers need to follow them.