Skip to content
PDFToolz

TXT to PDF Converter

Open a .txt file or paste text and get a tidy PDF with your line breaks kept, on A4 or Letter pages with the margins and text size you pick.

Select a text file

or drop it anywhere on this page, or paste

Opens in your browser. Nothing is uploaded.

Input format
Paste content
Page
Margin (mm)
Text size (pt)

Markdown keeps headings, bold, italic, lists, quotes and code blocks. HTML is read as plain text: tags, scripts, styles and images are left out, and nothing is loaded from the web.

Preview
Your pages appear here as you type.

!Paste some content or choose a file

TXT to PDF Converter, free and private

Convert a TXT file to PDF, or paste text and turn it into a PDF. Every line break, blank line and leading space stays where you put it, and long lines wrap at the margin. Pick A4 or Letter, the margins and the text size, and the live preview shows the pages as they will print.

Use it for notes, logs, transcripts, lists, poems or any Notepad or TextEdit file that has to be sent or printed as a PDF. It is free, and the PDF is made in your browser, so the text is never uploaded.

How to convert a text file to PDF

  1. 1

    Open a .txt file or paste text

    Choose a .txt file, or paste or type into the box. A loaded file appears in the box, and edits you make there go into the PDF. Your original file is not changed.

  2. 2

    Keep Plain text selected

    Plain text is the input format here, so * and # print as typed. Switch to Markdown only if the text uses # headings and ** for bold.

  3. 3

    Set the page

    Choose A4 or Letter. Set Margin (mm) from 5 to 40 (20 by default) and Text size (pt) from 8 to 20 (11 by default).

  4. 4

    Create and download

    Press Create PDF. The summary shows how many pages the text filled. Check it with Preview, then press Download PDF.

Why use PDFToolz for this

Line breaks kept

Each line of the file starts a new line in the PDF, blank lines stay blank, and spaces at the start of a line become an indent. Tabs count as four spaces.

Long lines wrap

A line wider than the page wraps onto the next line instead of running off the edge. A very long word with no spaces, such as a URL, is split.

Selectable, searchable text

The PDF holds real text, not a picture of it, so it stays sharp when zoomed and you can search, select and copy it.

Nothing uploaded

The text is read and typeset on your device with JavaScript. There is no account, watermark or size cap.

Fonts and characters

Text is set in a sans-serif font. It covers Latin letters with accents, such as é, ß, ș or ł, plus Greek and Cyrillic and common symbols such as €. Chinese, Japanese and Korean characters are not in the font and show as empty boxes.

Several spaces in a row inside a line print as one space, and the font is proportional, so text lined up into columns with spaces, such as an ASCII table, will not stay aligned. Switch the input format to Markdown and put those lines inside a fenced code block (```), which is set in Courier with every space kept.

Other ways to make a PDF from text

Pick the converter that matches what you have:

  • Markdown notes or a README: Markdown to PDF formats # headings, lists, bold text and code blocks.
  • A Word document: Word to PDF keeps its fonts, tables and pictures.
  • An HTML page: HTML to PDF keeps its styles and layout.
  • A spreadsheet or CSV file: Excel to PDF draws the rows as a table.

On Windows or a Mac without a website

Windows has a built-in printer called Microsoft Print to PDF: open the file in Notepad, choose Print and pick that printer. On a Mac, open the file in TextEdit and choose File > Export as PDF. Both use the app's own page settings, while this tool lets you set the page size, margins and text size and see the result before saving.

Frequently asked questions

Last reviewed . See how we build and test our tools, or report an error.

Related tools and guides