Text to PDF

Convert your Text files to PDF, right here in your browser.

... or drop files here

Files never leave your device

Add a Text file to convert.

Frequently asked questions

What is actually inside a Text file?

A .txt file is characters and line breaks and nothing else: no styling, no structure, no metadata to lose.

Are my files uploaded to a server?

No. Your Text file is read and the PDF is built entirely inside your browser, so nothing ever leaves your device.

Can I convert several files at once?

Yes. Add as many Text files as you like and download the PDFs one by one, or all together as a ZIP archive.

Will the layout look exactly like the original?

The text, headings, lists and tables carry over and are laid out onto clean A4 pages. This is a content-faithful conversion rather than a pixel-perfect copy of the original formatting.

Is there a file size or file count limit?

No. Everything runs on your own device, so the only practical limit is how much memory your browser has available.

Do I need to install anything?

No. There is nothing to install and no account to create — the converter runs in any modern browser, on desktop and mobile alike.

Why does my text have strange characters like é in it?

The file is not saved as UTF-8 — it is almost certainly Windows-1252, the default in older versions of Notepad, where the bytes for an accented letter mean something else entirely when read as UTF-8. Reopen it in any modern editor, save it explicitly as UTF-8, and convert again. There is no way to detect this automatically, because a plain text file carries no record of its own encoding.

Are my line breaks preserved?

Yes. Every line in the file becomes a line in the PDF, and blank lines stay as spacing, so a deliberately laid-out text file keeps its shape. The exception is a line too long for the page, which wraps rather than being cut off.

Will my tab-aligned columns stay aligned?

No. Tabs are expanded to spaces and the text is set in a proportional font where an i is narrower than an m, so columns that lined up in a monospaced editor will not line up here. If the alignment is the content — a table, a report, ASCII art — converting the file as a .csv or through the general PDF converter gives you a monospaced setting that holds.

Can I control the font, size or margins?

Not on this page — it lays out at a fixed, readable size on A4. That is a deliberate limit rather than an oversight: a plain text file carries no formatting to honour, so any choice is the converter's, and offering a panel of typography controls for a format with no typography adds complexity to the common case of wanting a text file readable as a PDF.

Is there a size limit?

Only your own machine's memory. Nothing is uploaded, so there is no per-file cap and no queue — but a very large text file is laid out page by page on your own processor, so a multi-megabyte log will take a noticeable moment and produce a PDF with a great many pages.

A .txt file is the one document format with nothing in it but the words. No styles, no page size, no fonts, no margins — just characters, and line breaks between some of them. That is what makes it durable, and it is also what makes converting it to PDF a series of decisions the file itself cannot help you with.

Every one of those decisions has to be made by the converter: how large the type should be, how wide the measure, where a page ends, and what to do with a line longer than the page. This one sets body text at 11 point on A4 with even margins, and wraps overlong lines rather than letting them run off the edge — the choice that keeps text readable, at the cost of the original line endings on very long lines.

It also has to guess at nothing regarding the characters themselves, because the file is decoded as UTF-8. That is the correct assumption for essentially everything written this century, and the source of the one classic failure described below.

How to convert a text file to PDF

  1. Add your .txt files

    Drop them in or choose them, as many as you like. Each becomes its own PDF with the same name.

  2. Convert

    The file is decoded as UTF-8, line endings are normalised — Windows CRLF, old Mac CR and Unix LF all treated alike — and each line becomes a paragraph laid out on the page.

  3. Download

    Save the PDF. The original is untouched and nothing was uploaded.

Line endings, and why they need normalising

Three conventions for ending a line are still in circulation: LF on Unix and macOS, CRLF on Windows, and a bare CR from classic Mac OS that turns up in genuinely old files. A converter that only recognised one of them would render a Windows file with a stray character at every line end, or a classic Mac file as one enormous unbroken line.

All three are normalised before layout, so a file written on any system converts the same way. This is invisible when it works, and unmistakable when it does not — which is why it is worth saying that it is handled.

What the layout does with your text

Line breaks
Respected. Each line in the source becomes its own line in the PDF, so a text file that was hand-wrapped or deliberately laid out keeps its shape.
Blank lines
Preserved as spacing, so paragraphs separated by an empty line stay separated.
Long lines
Wrapped at the page margin rather than clipped. A single 400-character line becomes several lines in the PDF. This is the one place the output deliberately departs from the source, on the grounds that text you cannot see is worse than text on the wrong line.
Tabs
Expanded to spaces. Tab-aligned columns in a plain text file will therefore shift, because the output is set in a proportional face where every character has its own width.
Page breaks
Inserted wherever the text runs out of vertical room. A .txt has no page concept to preserve, so there is nothing being overridden.

Encoding: the one thing that goes wrong

If your text arrives full of characters like é or ’ where accented letters and curly quotes should be, the file is not UTF-8. It is almost certainly Windows-1252 or Latin-1, the single-byte encodings that Notepad used by default for decades, in which each byte is one character and the same bytes mean something different.

The fix takes a moment. Open the file in a modern editor — Notepad, VS Code, TextEdit — and save it explicitly as UTF-8; every one of them offers the choice, and current versions of Notepad default to it. Convert the re-saved file and the accents come back.

Going the other way is impossible to do reliably: there is no marker in a plain text file that says which encoding it uses, so a converter cannot detect it, only assume. Assuming UTF-8 is the assumption that is right almost always, which is why it is the one made here.

Text in other writing systems

The standard PDF fonts handle Latin characters and nothing else, so a file in Russian, Greek, Arabic, Hebrew, Hindi, Thai, Chinese, Japanese or Korean cannot be laid out with them.

When the text needs glyphs outside that range, the converter draws the pages using the fonts already installed on your device — which cover those scripts and handle right-to-left layout properly — and embeds the finished pages into the PDF. It reads and prints correctly; the trade is that the text on those pages is an image rather than selectable text.

About the Text format

.txt is the plain-text format ASA/ANSI introduced in 1963. It is published as an open specification under the name US-ASCII / UTF-8, so a file can be read without the program that wrote it.

A .txt file is characters and line breaks and nothing else: no styling, no structure, no metadata to lose.

Files like this usually come out of Notepad, TextEdit, and nano.

What comes through

  • body text
  • reading order
  • page breaks

What does not

  • heading levels
  • embedded images
  • table rows and columns
  • embedded fonts

Worth knowing

  • Plain text carries no styling at all, so the output uses one readable typeface throughout and takes its structure from blank lines.
Information
  • Windows
  • Linux
  • Mac
  • iPhone
  • Android

How to use Text to PDF

Convert your Text files to PDF, right here in your browser.

Many tools available

This site offers numerous tools for working with PDFs — merging, splitting, converting, signing, and more.

Easy to use

PDF Goat 24 makes editing PDFs as fast and simple as possible. There's nothing to install or configure — just use the tool right here.

Works on your system

There are no special requirements. This tool works in any modern browser, on Windows, Mac, Linux, and mobile.

No installation required

You don't need to install any software. Everything runs directly in your browser, right where you are.

Security is important to us

Your files are processed entirely in your browser and are never uploaded to a server, so they always stay private.

More great tools

Share this page

Please rate this app