Text to PDF Converter

Convert text to PDF with real page layout: pick the page size, margins, font size, and line spacing, add a title and page numbers, and check a preview of the first page. Your text is not uploaded.

Updated
Runs in your browser. Your text is not uploaded.

Your text

Page settings

Printed at the top of the first page and saved as the document title.

Preview

A preview of the first page will appear here
  1. Paste text, upload a .txt file, or load the sample
  2. Pick the page size and font size
  3. Check the preview, then create the PDF

How to turn a text file into a PDF

  1. Paste your text, upload a .txt file, or press Load sample.
  2. Pick the page size, orientation, font size, margins, and line spacing.
  3. Type a title if you want one on the first page, and choose whether to number the pages.
  4. Press Create PDF. The first page appears in the preview, and the file is ready to download. Later changes update the preview.

How it works

The text is laid out with pdfmake, which wraps each line to the width between the margins and moves to a new page when one is full. Every line of your text stays a line, empty lines stay as space, and leading spaces are kept, so indented lists still line up. Tabs become four spaces.

The font is Roboto, embedded in the PDF so it looks the same on every device. Line spacing is a multiple of the font size: at 11 pt and 1.4, lines sit about 15.4 points apart. The preview is the real file's first page, drawn by pdf.js.

Examples

  • The sample packing list on A4 with 20 mm margins, 11 pt text, and page numbers fits on one page, with its indented food items still indented.
  • A 3,000-line log file at 9 pt on A4 landscape with 10 mm margins keeps long lines readable and prints one timestamp per line.
  • Meeting notes with the title "Board meeting, 12 May" get that title in large bold type at the top, and as the PDF's title in the reader.

Limitations

  • Roboto covers Latin, Greek, and Cyrillic letters. Text in Arabic, Persian, Hebrew, Chinese, Japanese, Korean, or Indic scripts would print as empty boxes, so the tool stops and names the first character it can't show.
  • No bold or italic inside plain text. For formatting, write Markdown and use Markdown to PDF.
  • Text files up to 5 MB.

Frequently asked questions

How do I convert a TXT file to PDF?

Press Upload .txt or drop the file on the text box, pick your page settings, and press Create PDF.

Will my line breaks and spacing be kept?

Yes. Each line stays on its own line, empty lines are kept, and leading spaces are preserved. Only lines longer than the page width wrap.

Can I add page numbers?

Yes. Turn on Page numbers to print 1 / 3, 2 / 3, and so on at the bottom of each page.

Why can't I convert text in Persian or Chinese?

The built-in font, Roboto, has no letters for those scripts, and the PDF would show empty boxes. The tool stops instead of producing a broken file.

Often used together with the Text to PDF.

  • Markdown to PDF

    Turns Markdown with headings, lists, tables, and code into a formatted PDF.

  • Text to DOCX

    Makes a Word .docx file from plain text, with headings and your font.

  • PDF to Text

    Pulls the text out of a PDF with lines, paragraphs, and page marks rebuilt.