Text to PDF Converter

Turn a plain text file into a properly laid out PDF. It wraps to the page width, breaks across pages where it should, and shows you the real page count before you build anything. Paste text straight in or drop a file. Nothing is uploaded.

  • Nothing uploaded
  • Works with no signal
  • No sign up
  • Searchable output
Drop a text file here or click to choose one. Plain text, logs, notes, CSV, code. Nothing is changed until you press the button.

or paste it in

Nothing loaded yet.

Preview

Showing how the text falls onto the page.

Add some text to see the pages.

Text goes in as real text, not as a picture of text, so the finished PDF stays searchable and you can select and copy from it.

Your text never leaves this device.The file is read by your browser, the PDF is built here in the page, and the download comes from your own machine. Nothing is sent to a server, so nothing is stored on one. Open the network tab in your browser tools and convert something: there is no upload request to see.

1 Drop your file in Or paste the text straight into the box. It never leaves your machine.
2 Set the page Paper, margin, typeface and size. The page count updates as you change them.
3 Build and download The PDF is assembled here in the page and saved from your own browser.

Laid out properly, not just poured onto a page

Plain text has no idea how wide a page is. Every line runs on until something stops it, and that something is usually the edge of the paper.

This works out where each line should break using the real widths of the characters in the typeface you chose, then fills each page to the exact number of lines that fit. What you see in the preview is where the finished document breaks.

How to use this tool

Drop a text file on the box at the top or paste straight into the panel underneath. Either way the preview and the page count appear immediately.

Set the paper, margin, typeface and size. Every one of those changes how much fits on a line, so the page count moves as you adjust them.

The preview shows each line at its real width and position on the page, so you can see where things break before you build anything.

Choose Courier if alignment means anything

This is the setting that matters most and the one people get wrong.

In Helvetica and Times, an i is narrow and an m is wide. That reads well in prose and destroys anything that relies on columns lining up. A log file, a directory listing, a table of readings laid out with spaces, a block of code: all of them depend on every character occupying the same width, and in a proportional typeface they turn into a ragged mess.

The same table in Courier with aligned columns and in Helvetica where the same spaces no longer align
Identical text and identical spaces. Only the typeface differs.

Courier gives every character identical width, so spaces used for alignment still align. The cost is that it fits fewer words on a line, so the same text runs to more pages. For prose that trade is not worth making; for anything structured it absolutely is.

How the wrapping actually works

Lines are measured against the real width of the characters in the typeface you picked, taken from the PDF font itself. That is why the preview breaks in the same places the finished document does rather than approximately.

Words are kept whole where possible. A word is added to the current line only if it still fits, otherwise the line is finished and the word starts the next one.

A single word wider than the whole line is a special case with no good answer, only a least bad one. Leaving it whole makes it run off the edge of the page where nobody can read it, so it is broken across lines instead. Long file paths, hashes and URLs are the usual culprits.

Blank lines in your source are kept, because they are usually deliberate paragraph breaks, and tabs become four spaces so that indented text keeps its shape.

A worked check you can repeat

Take A4 portrait with a 20 mm margin, 11 point type and normal 1.4 line spacing.

A4 is 595.28 by 841.89 points. A 20 mm margin is 20 times 72 divided by 25.4, which is 56.69 points a side, leaving a text area 481.9 points wide and 728.5 points tall.

Each line occupies the font size times the line spacing, so 11 times 1.4, which is 15.4 points. Dividing 728.5 by 15.4 gives 47.3, and you cannot have a third of a line, so 47 lines fit on a page. Feed in exactly 47 lines and you get one page; feed in 48 and the last one starts a second page on its own.

That arithmetic was checked against an independent implementation before publishing: thirty five hand written cases covering wrapping at the exact line width, one character over, unbreakable words longer than the page, collapsed spaces, blank lines, Windows and old Mac line endings, tabs, margins larger than the page and fonts too tall for a line. Then twenty five thousand generated cases confirming that no wrapped line ever exceeds the width it was given, that wrapping never loses or invents a character, and that no page ever holds more lines than it has room for.

Mistakes that catch people out

Converting a log in a proportional font. The columns will not line up. Use Courier for anything where spacing carries meaning.

Expecting the original line breaks to survive exactly. Lines longer than the page must wrap. Widen the page, shrink the margin or reduce the font if you need the original lines intact.

A last page holding one line. Usually a slightly smaller margin or font pulls it back onto the previous page. The status line tells you when this has happened.

Setting a margin larger than the paper. There is then no room for any text at all, and the tool says so rather than producing blank pages.

Pasting many megabytes. Everything happens in your browser, so an enormous document will make the tab work hard. Split it if the preview becomes sluggish.

Common questions

Is my text uploaded anywhere?

No. The file is read by your browser, the PDF is built here on the page, and the download comes from your machine. Nothing crosses the network, so there is nothing on a server to store or delete.

Will the text stay searchable?

Yes. It goes in as real text rather than as a picture of text, so the finished PDF can be searched, selected and copied from, and a screen reader can read it.

Why does my log file look misaligned?

Because the typeface is proportional. Columns only line up when every character is the same width, so choose Courier for logs, code, tables and anything where alignment carries meaning.

What happens to a line longer than the page?

It wraps onto the next line rather than running off the edge. A single unbroken word wider than the page is split across lines, because there is no alternative that keeps it visible.

Can I paste instead of uploading a file?

Yes, and it updates as you type. The page count and preview follow along, so you can adjust the margin or font until it falls the way you want.

Why did my page count change when I changed the font?

Because a different typeface fits a different number of characters on a line, which changes how many lines there are, which changes how many pages. Courier is the widest of the three and will usually give you the most pages.

Related PDF tools and reference

Reference: ISO 216, the standard that defines the A series paper sizes used here.