Markdown to PDF Converter
Operator: Abdulla Al Fahad. How tools are built and checked
Markdown is written to be read as source, but the moment a README, a specification or a set of release notes has to be attached to an email or printed for a meeting, someone needs a PDF of it. The Markdown to PDF Converter parses the text with the same CommonMark and GitHub-flavoured parser as the Markdown to Word tool, then sets it onto Letter or A4 pages in standard fonts, with real line wrapping and a page footer. Drop a .md file or paste a snippet and press Convert text; Try a sample drops a short project plan into the box.
The result is a document, not a rendered web page. Headings are sized by level, code is set in Courier with its line breaks intact, pipe tables become ruled tables with a shaded header row, and the footer counts pages. Two things a GitHub preview shows are missing: images, which are counted and reported rather than embedded, and task-list check boxes, which the standard PDF fonts cannot draw and which therefore appear as question marks with a warning.
Key features
- Reads the same CommonMark and GitHub-flavoured syntax as the Markdown to Word converter, including pipe tables, task lists, fenced code and reference links.
- Page design borrowed from the Word to PDF converter: standard fonts, hanging-indent lists, gridded tables with repeated header rows, a numbered footer.
- Sets code in Courier with its indentation intact and splits tokens wider than the page instead of dropping them.
- Names the PDF after the first heading when you paste, reports skipped images and replaced characters, and shows the page count before you download.
- Accepts .md, .markdown, .mdown and .txt files as well as pasted text.
How Markdown is set on the page
The syntax recognised is the CommonMark core plus the GitHub extensions in everyday use: headings, emphasis, strikethrough, code spans and fences, blockquotes, nested lists with task boxes, pipe tables, all three link forms and inline HTML, with front matter stripped and indented code deliberately ignored. The Markdown to Word page lists those rules in detail; this page is about what happens to them on a printed page.
Fenced and inline code use Courier at the body size with no background shading. Each level of list nesting indents a further quarter inch with a dot bullet at every level, and numbered lists restart at 1 for each run of numbered items regardless of the numbers you typed. A blockquote is indented by half an inch with no bar, a horizontal rule becomes an empty line rather than a drawn line, and a pipe table gets equal column widths whatever its content, so six columns on Letter means about an inch each. Linked text is blue and underlined, but the PDF contains no link annotations: nothing is clickable and the URL itself is not printed.
Fonts, sizes, margins and the Page N of M footer are the Word to PDF converter's, described in full on that page. The title a reader shows in its title bar, which also names the download, is the first heading when you paste or the file name when you upload; without either the file is called Converted document.pdf. Symbols outside the standard fonts' Western European repertoire are drawn as question marks and listed in a warning, and a document mostly in another script is refused and pointed at the Word editor's print route.
How it works
Parsing happens in two layers. The block layer walks the lines and decides what each one begins, recursing into list items and blockquotes so that a bullet inside a bullet or a quote inside a list comes out at the right depth; reference-link definitions are collected first so that they can appear after the text that uses them. The inline layer then scans each block's text once, matching code spans before emphasis so that asterisks inside backticks stay literal.
The blocks are then set by the PDF writer the Word to PDF tool documents in full: it checks the text against the fonts' character set, measures and wraps every line, places the lines down each page and draws the footer last. Because the layout is deterministic, the same Markdown always produces the same PDF, and the page count in the summary is exact rather than an estimate.
Common use cases
- A developer prints a repository's README and CONTRIBUTING guide for a code review held around a table.
- A consultant drafts a statement of work in a Markdown editor and sends the client a PDF rather than source text full of asterisks.
- A technical writer converts release notes to PDF so they can be attached to a ticket or a customer email.
- A student exports lecture notes from Obsidian or Notion as Markdown and turns them into a printable PDF with the nested bullet points intact.
- A team lead pastes the Markdown a chat assistant produced and gets a tidy PDF for a meeting pack without reformatting it by hand.
How to use this tool
- Paste Markdown and press Convert text, or drop a .md file; Try a sample loads a short plan to experiment with.
- Switch Page size between US Letter and A4 if the default is wrong for your reader; the PDF page chip updates as you switch.
- Check the warning line (skipped image references, replaced characters) and look in the preview for stray pipe characters.
- Download the .pdf, or open the text in the Word editor first to fix anything the preview showed.
Example
Markdown input
---
title: Release notes
---
# Release 2.4
Shipped on 3 June.
Hotfix 2.4.1 followed a week later.
## Checklist
- [x] Database migration
- [ ] Update the docs
```bash
npm install
npm run build
```
***
| Area | Owner |
| --- | --- |
| API | Priya |
Read the [changelog](https://example.com/changelog).Release 2.4.pdf (front matter removed, first heading names the file)
Release 2.4 Helvetica-Bold 20pt
Shipped on 3 June. 11pt; the two trailing spaces force a break
Hotfix 2.4.1 followed a week later.
Checklist Helvetica-Bold 15pt
• ? Database migration ☑ cannot be drawn -> "?"
• ? Update the docs ☐ cannot be drawn -> "?"
npm install Courier 11pt, no shading
npm run build
(empty line where *** was)
| Area | Owner | header row bold on a grey fill
| API | Priya | equal column widths
Read the changelog. "changelog" blue + underline, not clickable
Page 1 of 1
Warning: 2 characters could not be drawn by the PDF fonts and were
replaced with "?" (for example ☑, ☐).
Summary: 34 words · 3 paragraphs · 2 headings · 2 list items · 1 table · 1 PDF pageTips for best results
- Leave a blank line before and after tables, lists and code fences. The parser copes without one in most cases, but a blank line removes any doubt about where a block starts.
- Keep code lines under 70 characters. Courier at 11pt fits 70 characters across a Letter page and 68 across A4; longer lines wrap at spaces, and a single token wider than the page is split character by character.
- If pipes are still visible in the preview, the table is missing its delimiter row of dashes under the header.
- A horizontal rule (--- or ***) produces an empty line rather than a drawn rule, so use a heading when you need a visible break between sections.
- Replace [ ] and [x] with words such as (open) and (done) before converting when the document has to read cleanly; the boxes cannot be drawn.
Edge cases to watch
Task boxes become question marks, and the warning lists them.
Images are left out entirely: no picture, no alt text, no placeholder; only the count is reported.
Links are decorative, and reference-style definitions at the foot of the file are consumed rather than printed.
Fenced code has no shading, border or syntax highlighting, so a code block is distinguished from prose only by the Courier face.
Common errors and how to fix them
- Paste some Markdown first.
- The text box was empty, or contained only spaces, when you chose Convert text. Paste the Markdown, or use Try a sample, then convert again.
- No text was found in the pasted Markdown.
- Everything you pasted was removed before layout: a front matter block on its own, a file made only of image references, or an HTML comment. Add some prose or a heading and convert again.
- This converter accepts Markdown files (.md, .markdown, .txt), up to 25MB. "notes.docx" has a different extension.
- Only .md, .markdown, .mdown and .txt files are accepted. A Word document is not Markdown even when it contains Markdown-looking text; run it through the Word to Markdown converter on this site, or save it as plain text, and upload that.
Best practices
- Write headings with # rather than bold text. Only heading syntax produces the larger type and the keep-with-next behaviour; a line of **bold** stays an 11pt paragraph.
- Run the converter early rather than at the end: the warnings show at once which symbols and images will not reach the PDF, while the text is still easy to change.
- Use a pipe table only for genuinely tabular data; a two-column table used for layout gets two equal half-width columns in the PDF.
Code blocks and task boxes on the page
A fenced block is set line for line in Courier at the body size. Leading spaces are kept, so indentation survives, and a line too wide for the measure wraps at a space or, if it contains none, is split into character chunks that each fit. There is no shading, border or syntax colouring, because the PDF has no equivalent of the styling that makes code blocks stand out on GitHub; if the distinction matters, a one-line caption above the block does the job. Inline code gets the same treatment, so a variable name in a sentence is simply Courier within Helvetica.
Task boxes are a different kind of loss. The parser turns [ ] and [x] into the ☐ and ☑ characters, which is right for a Word file, but the standard PDF fonts cover only 218 characters and those two are not among them. The exporter replaces each with ? and adds a warning naming the characters, as the example shows. The fix is in the source: write (done) and (open), or use a plain bullet, before converting.
Frequently asked questions
Why do my check boxes show as question marks?
The PDF fonts cannot draw the ☐ and ☑ characters that task lists become, so each is replaced by ? and listed in the warning. Write the state in words if the PDF needs it.
Are links in the PDF clickable?
No. Linked text is coloured blue and underlined so the reader can see it was a link, but no link annotation is written and the URL is not printed. Include the address in the text if people need to follow it from paper.
Can I style the PDF with CSS or choose a font?
Not in this tool. Fonts, sizes, margins and spacing are fixed, which keeps the file small and the output predictable. For a styled PDF, convert with the Markdown to HTML tool, open the page in a browser and print it to PDF from there.
Why is the download called Converted document.pdf?
Because the pasted text had no heading to take a title from. Add a # heading at the top, or upload the file instead, since an uploaded file's own name is used.