Home › PDF Tools › Text to PDF Converter

Text to PDF Converter

Paste text or open a .txt file, pick a font, size, margins and paper, and get a neatly paginated PDF. The preview shows exactly how each page will look.

.pdf
Pages–
Lines / page–
Page 1 of 1
Advertisement
Advertisement

How to use the Text to PDF Converter

  1. Paste your text into the box or click Open .txt to load a file.
  2. Choose the font, size and line spacing, then the page size, orientation and margins.
  3. Optionally add a title and page numbers.
  4. Check the preview; use the arrows to flip through the pages.
  5. Press Download PDF to save the file.

Lines per page: the formula

The number of lines that fit on a page depends on the usable height and the line pitch:

lines per page = ⌊(page height − top margin − bottom margin) ÷ (font size × line spacing)⌋

Worked example: A4 is 841.89 pt tall. With 20 mm margins (20 × 72 ÷ 25.4 = 56.69 pt each) the usable height is 728.5 pt. At 12 pt and 1.5 spacing each line takes 18 pt, so 728.5 ÷ 18 = 40.5, which rounds down to 40 lines. A 100-line text therefore needs 3 pages (40 + 40 + 20).

Paper, 20 mm margins11 pt, single12 pt, 1.1512 pt, 1.512 pt, double
A4 (841.89 pt)66524030
US Letter (792 pt)61493728
Legal (1008 pt)81644937
A5 (595.28 pt)43342620

Paper sizes and units

PaperMillimetersInchesPoints
A4210 × 2978.27 × 11.69595 × 842
US Letter215.9 × 279.48.5 × 11612 × 792
Legal215.9 × 355.68.5 × 14612 × 1008
A5148 × 2105.83 × 8.27420 × 595
A3297 × 42011.69 × 16.54842 × 1191

PDF measures everything in points: 1 inch = 72 pt and 1 mm = 2.835 pt. A one-inch margin is 72 pt, the same as 25.4 mm.

Tips for good-looking text PDFs

  • Code, logs and tables: use Courier so every character has the same width and columns stay aligned. Turn on line numbers to make it easy to refer to a line.
  • Essays and letters: Times at 12 pt with 1.5 or double spacing is the usual school and office standard.
  • Reading on a phone: A5 portrait with 12 mm margins and 11 pt Helvetica gives short, comfortable lines.
  • Wide text: switch to landscape when your lines are long, for example CSV exports or spreadsheets pasted as text.

Frequently asked questions

Is my text uploaded anywhere?

No. The PDF is created by jsPDF directly in your browser, so your text and files never leave your device.

Which font should I choose?

Helvetica is a clean sans-serif for notes and letters, Times is a classic serif for essays and long reading, and Courier is monospace, so it keeps columns lined up in code, logs and plain-text tables.

Why are some characters shown as a warning?

The three built-in PDF fonts only cover Western European (Latin-1) characters. Letters such as Cyrillic, Greek, Chinese or emoji cannot be drawn with them, so the tool lists them before you download. They are replaced with a question mark in the PDF.

Will the line breaks in my text be kept?

Yes. Every line break and blank line is kept. Long lines are wrapped at word boundaries to fit the margins, and a very long word without spaces is split where it reaches the edge. Tabs become four spaces.

How many lines fit on a page?

Lines per page = usable height ÷ (font size × line spacing). On A4 with 20 mm margins and 12 pt text at 1.5 spacing, that is 728.5 ÷ 18 = 40 lines. The preview always shows the exact page count.

Can I convert a big text file?

Yes. Files with tens of thousands of lines work; the preview shows one page at a time so it stays fast.

Related tools