Text to PDF Converter — Free Online Tool

Convert plain text to PDF documents with customizable fonts, sizes, and layout. No server uploads, no sign-ups. 100% client-side — your data stays private.

Text to PDF

PDF Settings

How do you turn a text file into a PDF? You choose a page size, decide where each line breaks, and write the characters at fixed coordinates. This tool does that with pdf-lib: it measures your text against the column width using the real font metrics, wraps it into lines, and draws them down A4, Letter, Legal, A3 or A5 pages. The result contains genuine text objects, so it stays selectable and searchable.

How to Convert Text to PDF

  1. Paste your text — Type or paste into the left editor, or press Load Sample to see the layout with real content. Blank lines are kept, so paragraph breaks survive the conversion.
  2. Choose a typeface and size — Pick one of the seven font entries and set the size between 6 and 36 points. Line spacing runs from 1.0 to 3.0 and multiplies the size to give the distance between baselines.
  3. Set the page geometry — Choose A4, Letter, Legal, A3 or A5, portrait or landscape, and one of four margin widths. Landscape simply swaps the page width and height.
  4. Check the live preview — The right panel re-renders as you change settings. It is a good guide to density and line breaks, though it uses your system fonts rather than the ones written into the PDF.
  5. Convert and download — Click Convert to PDF, then Download PDF. Pagination is worked out from the settings, so a smaller size or tighter spacing fits more lines per page.

How Text to PDF Conversion Works

A plain-text file has no layout. It is a stream of characters with newlines, and nothing in it says how wide a line should be, what a page is, or which typeface to use. A PDF is the opposite: every glyph sits at an absolute coordinate on a page of a stated size. Converting one to the other means inventing all the layout decisions the text file never made, which is what the settings panel is for.

The tool builds the document with pdf-lib. It embeds one of the standard fonts that every PDF reader already has, then works out the text column as the page width minus twice the margin. Your text is split on newlines into paragraphs, and each paragraph is wrapped greedily: words are added to the current line while the font reports that the line still fits, and the moment it does not the line is committed and the word starts the next one. Measuring with the real font metrics rather than counting characters is why proportional fonts wrap correctly instead of overflowing.

Pagination then falls out of two numbers. The distance between baselines is the font size multiplied by your line spacing, and a new page starts as soon as the next line would fall below the bottom margin:

lineHeight = fontSize × lineSpacing linesPerPage = floor((pageHeight − 2 × margin) / lineHeight)

Every value here is in PDF points, the unit the format itself uses, where 72 points make one inch. That applies to the margin choices too: the labels say pixels, but a 40-point margin is about 14 millimetres of real paper. Because the characters are written as text rather than painted as a picture, the finished PDF can be searched, copied from, read aloud by assistive software and re-flowed by tools that extract its content.

Fonts and What Actually Reaches the PDF

PDF guarantees fourteen standard fonts that every reader can display without embedding anything. This tool uses three of them, and the seven entries in the font menu map onto those three. The preview shows the CSS font on your machine, so a substitution happens between what you see and what you get.

Menu entryWritten into the PDFBest for
ArialHelveticaGeneral documents and a clean modern look
VerdanaHelveticaScreen reading at small sizes
Times New RomanTimes RomanFormal documents, academic papers
GeorgiaTimes RomanLong-form reading and articles
CourierCourierCode listings and typewriter-style text
Lucida ConsoleCourierData tables and alignment-sensitive content
ConsolasCourierCode snippets and developer documentation

In practice that means three real choices: sans-serif, serif or monospace. Choose Courier when column alignment matters, because it is the only fixed-width option and every character occupies the same advance width.

Page Sizes

SizePoints (portrait)Millimetres or inchesWhere it is standard
A4595.28 × 841.89210 × 297 mmDefault almost everywhere outside North America
Letter612 × 7928.5 × 11 inUnited States and Canada
Legal612 × 10088.5 × 14 inNorth American legal and contract work
A3841.89 × 1190.55297 × 420 mmPosters, plans, wide tables
A5419.53 × 595.28148 × 210 mmBooklets, handouts, half-sheet notes

Getting Good Output

  • Body text sits comfortably at 11 or 12 points. Below 9 points a printed page becomes hard work, and above 14 you are effectively setting large-print copy.
  • Line spacing of 1.5 is the readable default. Drop to 1.2 to fit more on a page and go to 2.0 when the document will be marked up by hand.
  • Match the page size to the audience rather than to your screen. Sending Letter to a European printer, or A4 to a North American one, produces scaled margins.
  • Use Courier for anything where columns must line up. The proportional fonts will silently break ASCII tables and aligned code.
  • Wider margins of 60 or 80 points give roughly 21 to 28 millimetres of white space, which is what most binding and annotation needs.

Two things the preview does not tell you. The word-wrap toggle changes only the preview panel; the PDF always wraps to the column width. And a single unbroken run of characters wider than the column — a long URL or a hash — is trimmed to fit rather than hyphenated, so its tail is lost. Break long strings manually before converting.

Frequently Asked Questions

Open the text file in any editor, copy everything, and paste it into the left panel. Set the font, size, spacing, page size and margins, then press Convert to PDF and download the result. Nothing is installed and no account is needed, and the original file is untouched.

No. The layout is calculated and the PDF is assembled in the page you are looking at, so neither your text nor the finished file travels over the network. The pdf-lib script is fetched from a public CDN the first time you convert, carrying none of your content. Nothing survives closing the tab.

Three: Helvetica, Times Roman and Courier, from the standard set built into every PDF reader. The menu lists seven familiar names because they map onto those three — Arial and Verdana both become Helvetica, Georgia and Times New Roman both become Times Roman, and Courier, Lucida Console and Consolas all become Courier. Using them means the file needs no embedded font and opens identically everywhere.

Yes. Each line is written as a text object with a real embedded font, not painted as an image, so you can select and copy passages, search inside the document and have it read aloud by assistive technology. That also keeps the file small: a long text document usually produces a PDF of a few tens of kilobytes.

Yes, though the whole text is laid out in one pass in memory. Documents of a few hundred pages are fine on a normal machine. The preview panel is usually the slower half, since it re-renders on every keystroke, so paste first and adjust the settings afterwards rather than typing a long document into the box.

The preview draws with the CSS font installed on your computer, while the PDF is written with the standard font it maps to. Genuine Georgia and Times Roman have different metrics, so line breaks can fall in different places. Treat the preview as a guide to density and layout, and check the downloaded file for exact line breaks.

Not here — every line is drawn in one font at one size, which is what makes plain text conversion predictable. If your source has structure, write it as Markdown and use Markdown to PDF, which sets headings in a larger bold face and formats lists, quotes, code blocks and tables.

Wrapping happens between words. A single run of characters with no spaces cannot be broken, so if it is wider than the text column it is trimmed to fit instead of being hyphenated or overflowing the margin. Insert a space or a line break inside the string, reduce the font size, or widen the page or narrow the margins to give it more room.

Use Cases

Log Files for a Ticket

An engineer pastes a stack trace, sets Courier so the indentation holds, and attaches a paginated PDF to a bug report instead of a raw text dump.

Manuscript Submission

A writer sets 12-point type at double spacing on Letter pages, matching the formatting a publisher's submission guidelines ask for.

Meeting Agendas

An assistant turns a bullet list typed in a notes app into an A5 handout that prints two to a sheet for people around the table.

Terms and Policy Records

A small business archives the exact wording of its terms on a given date as a fixed PDF, so a later dispute can be checked against what was published then.

Wide Data Extracts

An analyst prints a fixed-width report on A3 in landscape, giving the columns enough width to avoid the wrapping that ruins alignment on a portrait page.