TXT to PDF Converter

Set a plain-text file on A4 pages as a PDF, right in your browser.

or drop files here

TX

TXT Format

Plain text file

A file that holds unformatted text with no fonts, styles or images. It is readable by any text editor, on any operating system.

  • No formatting
  • Character encoding such as UTF-8
  • Very small files
  • Readable everywhere
PD

PDF Format

Portable Document Format

A document format created by Adobe in 1993 and standardized as ISO 32000. It keeps text, fonts, images and layout the same on any device.

  • Fixed page layout
  • Embedded fonts
  • Vector and raster content
  • Optional encryption and signatures

How to convert a TXT file to PDF

Your text is laid out in your browser and saved as a PDF named after your file.

    1

    Upload your TXT file.

    2

    We set its text on A4 pages, up to 61 lines of 81 characters each, wrapping longer lines and starting a new page at each form feed.

    3

    Download the PDF, which opens and prints the same on any device.

What to know before converting TXT to PDF

  • Pages are A4 portrait with 3/4 inch margins, holding 61 lines of up to 81 Courier characters.
  • Long lines wrap, and a wrapped line is indented as far as the line it continues.
  • Blank lines and leading spaces are kept, and a form feed starts a new page.
  • No header, footer or page numbers are added.
  • A file over 20 MB or 2,000 pages is refused, and so is text with characters the font lacks.
  • Each file makes its own PDF, saved as the file's name with .pdf, and it is made in your browser.

About TXT and PDF files

What is a TXT file?

A TXT file is plain text: characters and line endings, with no fonts, styles, tables or pictures. Its media type is text/plain, and a charset parameter says how the bytes stand for characters. Plain text carries no commands for typography and sets no page layout, which is why any editor on any system can open it and why the files stay small.

You find .txt files as notes, logs, readme files, exported data and the text of old documents. Because there is no layout, there is no page size either. That is the gap a PDF fills: it turns the same lines into fixed pages that print and look the same on every device.

Line endings differ by system, so a TXT may end its lines with CR LF, CR or LF. This page treats all three as a line break, along with NEL and the Unicode line and paragraph separators. It reads the encoding from a byte order mark when there is one: UTF-8 or UTF-16. Without one it tries UTF-8 and then Windows-1252.

Programs that open TXT files

Windows

  • Notepad: the format reference's first choice for plain text.

Mac

  • TextEdit: handles plain text documents, including opening, editing and saving them.

Windows, Mac and Linux

  • Visual Studio Code: opens and edits text files in its editor.
  • Vim: a text editor that runs on all three.

TXT and PDF compared

  • Extensions and media types: .txt with text/plain, against .pdf with application/pdf.
  • Layout: a TXT has none. A PDF is a set of fixed pages that look the same everywhere.
  • Fonts: a TXT uses whatever font the viewer picks. A PDF embeds its fonts to keep its look.
  • Content: a TXT holds text only. Beyond text, a PDF can carry vector graphics and images, along with links, bookmarks and forms.
  • Standards: ISO adopted PDF 1.7 as ISO 32000-1 in 2008; PDF 2.0 followed as ISO 32000-2 in 2017.

This page sets your text on A4 portrait pages with 3/4 inch margins, in Courier at 10 pt with 12 pt between lines. That gives 61 lines to a page, each up to 81 characters, about what an 80-column printout holds. Nothing else is added.

Tabs stop at every fourth column, control characters and terminal escape sequences are dropped, and a line whose first letter is Hebrew or Arabic is set against the right margin, as an editor shows it. All-Windows-1252 text gets Courier; any other text gets DejaVu Sans, which has a wider range of letters but gives each its own width.

The PDF text is real text, not a picture of it, so a PDF reader can search and copy it.

Other ways to convert TXT to PDF

  • TextEdit (Mac): open the TXT, then choose File > Export as PDF. TextEdit lays the page out with its own settings, not a fixed grid of lines.
  • Adobe Acrobat: use File > Create > PDF from File, change the file-type filter in the Open dialog so TXT files show, pick the file, press Open and save the result. The layout follows Acrobat's settings.

Use a word processor route when you want your own fonts, headers or page numbers.

Problems with TXT files

  • Accents or symbols turn into odd characters: the file was saved in a different encoding from the one it is read in. Re-save it as UTF-8.
  • A line is cut off in the PDF: it is not cut. Lines longer than 81 characters wrap onto the next line, indented to match.
  • Text in Chinese, Japanese, Korean or emoji is refused: the PDF font lacks those glyphs. Use TXT to PNG, which draws them.
  • The file is rejected as empty: a file with only whitespace and control characters has nothing to set.
  • Tabs look narrow: tabs stop every fourth column in the PDF, so a file written for eight-column tabs will look tighter than in your editor.
  • Columns drift: the file has characters beyond Windows-1252, so the whole text was set in DejaVu Sans, where spaces do not line up columns. Remove those characters to get Courier.
  • A report keeps its page breaks only sometimes: a form feed ends a page that has a line on it, but does nothing on a page with none.

Frequently Asked Questions

Everything you need to know about our converter

How can I turn a TXT file into a PDF?

What font and page size does the PDF use?

Will my columns and spacing line up?

What happens to lines that are longer than the page?

Can I choose where pages break?

Why is my Chinese, Japanese or emoji text refused?

Why do accents or non-English letters look wrong?

Is there a size limit?

Can I add page numbers or a header?

Does the PDF have selectable text?