How to Turn Plain Text or Markdown Into a Clean PDF

By Docmint Team · · 4 min read

Paste text or Markdown, or drop a .txt or .md file, choose a font and page size, and download a typeset PDF with real, selectable text.

To turn plain text or Markdown into a clean PDF, paste it into Docmint's Text to PDF tool (or drop a .txt or .md file), pick a serif, sans or monospace font, set the font size, page size and margins, and click Create PDF. Markdown headings, lists, bold and italics are rendered, and the text stays real, selectable text in the PDF.

Why convert text to PDF at all?

Plain text files are perfect for writing but awkward to share. They open in different editors with different fonts, long lines wrap unpredictably, and some recipients do not know what to do with a .md file. A PDF looks the same everywhere, prints predictably and can be attached to an email, uploaded to a portal or archived without worrying about how it will render.

Typical cases include meeting notes, a README you want to hand to someone who does not use GitHub, a changelog for a client, a log excerpt for a support ticket, or a short letter you drafted in a notes app.

What Markdown formatting is supported?

Text to PDF understands the Markdown most people actually use: headings written with #, bullet lists with -, numbered lists, **bold**, *italic*, inline code, fenced code blocks and block quotes. Paragraphs separated by a blank line become separate paragraphs in the PDF.

Plain text works too. If your file has no Markdown at all, it is simply typeset as paragraphs in the font and size you choose. The live preview updates as you type, so you can see exactly how your headings and lists will look before you create the file.

What does not carry over?

Setting expectations helps here. The tool does not add images, so Markdown image links will not become pictures in the PDF. If you need images, create the text PDF first and then use Merge PDF to combine it with image pages. Features specific to certain Markdown flavors, such as tables or task checkboxes, are not on the supported list, so check the preview before relying on them.

The built-in fonts support Latin, Greek and Cyrillic characters. If your text uses other scripts, check the preview carefully before you share the result.

How to convert text or Markdown to PDF with Docmint

Everything runs in your browser, so private notes and internal documents never leave your device.

  1. Open the Text to PDF tool. Paste or type your text into the editor, or drop a .txt or .md file.
  2. Choose the font style: serif, sans or monospace.
  3. Set the font size, page size and margins, and check the live preview as you go.
  4. Click Create PDF and download the file. The text is embedded as real, selectable text.

Which font and page settings should you choose?

Serif fonts read comfortably in long printed documents such as letters and reports. Sans fonts look clean on screens and suit notes, summaries and handouts. Monospace is the right choice for anything where alignment matters: code, logs, command output or text laid out with spaces.

Pick the page size your readers will print on, since the paper size people expect varies by country. Wider margins make a document feel calmer and leave room for handwritten notes; narrower margins fit more on each page, which helps with long logs. A slightly larger font size is kind to anyone reading on a phone.

Tips for code, logs and long documents

  1. Wrap code and log output in fenced code blocks (three backticks before and after) and use the monospace font so indentation and columns line up.
  2. Pages break automatically. To start a new page at a specific point, such as before an appendix, add a line containing only ---.
  3. Use real Markdown headings rather than lines in capital letters. They are styled consistently and make the structure obvious.
  4. Leave a blank line between paragraphs and before lists. Missing blank lines are the most common reason a list runs into the paragraph above it.
  5. Read the preview from top to bottom before downloading, especially if the text was pasted from a web page or email and may contain stray characters.

Other ways to make a PDF from text

Almost any text editor or word processor can print to PDF, and macOS and Windows both include a built-in PDF printer. That is a fine option for a quick one-off, although Markdown will usually come out as raw symbols unless your editor renders it first. Many code editors and Markdown apps can export to PDF with more layout control, and command-line tools such as Pandoc are excellent if you convert documents regularly and are comfortable with the terminal. Text to PDF is the quick middle ground: Markdown is rendered, there is nothing to install, and the content stays on your device.

What to do with the PDF next

If the document is going to several people, you can add page numbers with the Page Numbers tool, or send it straight to Protect PDF with Continue with if the notes are confidential. For a README that should look official, setting a clear title with Edit Metadata helps when the file is stored in a document library.