OnlineTextLab
Esc

Markdown to PDF Converter

Write in Markdown and get a document with proper tables, code blocks and clickable links.

0 characters

Structure that will go into the PDF

Headings, lists, tables, code and links appear here as you type.

Page options

Page size

Orientation

Text size

Runs on your device. Your files and text are not uploaded.

About Markdown to PDF

Markdown is pleasant to write and awkward to send. Most people receiving a .md file see raw asterisks and pipes. Converting it gives them what you meant: bold words, numbered lists, a table with columns, a code block set apart from the prose.

Paste your Markdown or open a .md file, and the right-hand pane shows the structure that will go into the PDF as you type. The finished file has selectable text and links that open when clicked. It suits READMEs, project notes, checklists, short reports and anything else you wrote in a plain text editor and now need to hand to someone else.

How it works

Your Markdown is converted to HTML, cleaned of anything unsafe, and then laid out as a PDF by code written for this job. It is not a screenshot of a web page. Headings are drawn at six fixed sizes in Helvetica Bold, and a heading is never left alone at the bottom of a page, because it moves over when there is no room for two lines of what follows.

Tables share the page width according to how much text each column holds, so a narrow column of amounts does not take as much room as a column of descriptions. Long cells wrap inside their column, and when a table crosses a page break the header row repeats at the top of the new page. Code blocks are set in Courier on a shaded background, and they keep their indentation. A code line too long for the page is cut and continued on the next row, since wrapping at spaces would change its meaning. Links become real link annotations, as long as they start with http, https or mailto.

How to use Markdown to PDF

  1. Type or paste into the Markdown box, press Open a file for a .md or .txt file, or press Try an example.
  2. Check Structure that will go into the PDF on the right.
  3. Open Page options to change the page size, orientation, text size or document title, or to tick Add page numbers.
  4. Press Create PDF, then the download button. If your text needs a script the built-in fonts lack, press Print with my browser instead.

Part of the built-in example, read back from the finished PDF

Input
## Costs so far

| Item | Who paid | Amount |
|------|----------|--------|
| Ferry | Lena | 186.00 |
| Cabin | Marco | 64.50 |

> Check-in closes 45 minutes before departure.
Output
Costs so far
Item Who paid Amount
Ferry Lena 186.00
Cabin Marco 64.50
Check-in closes 45 minutes before departure.

The whole example came to one page and 2.4 KB. None of the Markdown symbols reached the file. The table is drawn as three columns with a shaded header row, and the link to the ferry site in the same example is clickable in the PDF.

When it helps

  • Sending a project README to a client who has no Markdown viewer
  • Handing in documentation or a lab report you wrote in a code editor
  • Printing a checklist kept in a notes app that stores its pages as Markdown

Tips for a better result

  • Put a blank line before a table or list. Without it, many Markdown parsers treat those lines as part of the paragraph above, and the preview pane will show that straight away.
  • Use a landscape page for a table with many columns. Cells wrap when the width runs out, and a wider sheet means fewer wrapped lines.
  • Use the Document title field if your text has no top-level heading. It prints large at the top of page one and names the file.

Good to know

  • Pictures linked from the web are not fetched. They appear as [Image not included: alt text]. An image embedded in the text as a PNG or JPG data URL does go in.
  • The look is fixed: Helvetica and Courier, with no themes or custom CSS, and syntax highlighting is not applied to code.
  • Only Western European characters can be printed by Create PDF. A notice names any others, which would become question marks. Print with my browser uses your device's fonts and handles other scripts.
  • Links inside the document, such as #section, are not made clickable. Footnotes and maths notation get no special layout.

Questions people ask

Are the links in the PDF clickable?

Yes, for web and email addresses. A link starting with http, https or mailto becomes a clickable area over the words and keeps its colour. Links to anchors inside the same document stay as plain text.

What is the difference between Create PDF and Print with my browser?

Create PDF builds the file here with fixed fonts and gives you a download. Print with my browser opens your system's print dialog, where you choose Save as PDF, and uses the fonts on your device. Use it for Chinese, Arabic, Cyrillic or any other text outside Western European characters.

Why is my picture missing from the PDF?

The tool does not download anything from the internet, so an image linked by address is replaced with a short note showing its alt text. The preview shows the same note. To include the picture, embed it in the Markdown as a PNG or JPG data URL.

What to use next

Last reviewed . Read our editorial policy.