PDF Edit Craft Files never leave your device

How to convert a TXT file to PDF

Turn notes, logs, code and plain-text documents into a tidy PDF that looks the same everywhere. The text in the PDF is real text, so you can search it, select it and copy it.

Do it now in the free PDF editorOpens in your browser. No sign-up, no watermark — your PDF is never uploaded.
Open the PDF editor

Convert TXT to PDF in four steps

  1. Open the PDF editor and choose or drop your .txt file.
  2. Pick the page size, orientation, font, size, line spacing and margins. The preview shows the first page as it will look.
  3. Click Create PDF. The new PDF opens in the editor, where you can add text, highlights, a signature or a watermark.
  4. Click Download to save the PDF.

See how it works

The Convert text to PDF dialog with a live preview of the first page and page, font and margin settings
  1. Choose the .txt file
  2. Check the preview
  3. Pick page size, font and margins
  4. Click Create PDF

Settings that matter for printing

  • Page size: Letter, Legal or A4, in portrait or landscape. Landscape is handy for wide logs and tables.
  • Font and size: monospace fonts keep the layout of the file, while sans serif and serif fonts read more like a document.
  • Line spacing and margins: Single to Double spacing, and narrow, moderate or normal (1 inch) margins.

The editor remembers your settings for the next text file. The page count updates as you change them, so you can fit a document on fewer pages before you create it.

Emoji and characters from scripts the chosen font does not cover are shown as “?”. Noto Sans and Noto Serif cover the most characters.

Frequently asked questions

Will columns and indentation in my text file stay aligned?

Yes, with a monospace font such as Cousine (Courier New) or Roboto Mono, which is the default. Every character has the same width, so tables made with spaces, code and tab-indented lists line up exactly. Tabs are expanded to 4-character stops.

What happens to long lines?

Lines longer than the page are wrapped at a space, like in a word processor. A very long word, such as a web address, is broken where it reaches the margin, so nothing is cut off.

Which text encodings are supported?

UTF-8 (with or without a BOM), UTF-16 and Windows-1252, the usual encoding of older Windows text files. Accented letters, curly quotes and symbols come out correctly. A form feed character in the file starts a new page.

Can I add page numbers?

Yes. Page numbers (“Page 1 of 3”) are on by default, and you can also print the file name at the top of each page.

Is my file uploaded?

No. The conversion runs in your browser and the file never leaves your device.

Ready to try it?Drop your PDF into the editor and download the result in seconds.
Open the PDF editor

More guides

Edit existing PDF textClick a line that is already in the PDF and retype it in a matching font.Add text to PDFType anywhere on a page in 26 fonts, any size and color.Sign a PDFDraw, type or upload your signature and place it on the page.Fill out a PDF formFill fields, tick checkboxes and choose options — even on non-fillable forms.Highlight text in a PDFHighlights that snap to the words and lines under them.Draw and add shapes to a PDFFreehand drawing, rectangles, ellipses, lines and arrows.Add an image to a PDFInsert a JPG, PNG, HEIC or WebP image, logo or stamp.Add a watermark to a PDFStamp text or a logo on every page, or only the pages you choose.Redact a PDF permanentlyBlack out confidential text so it is removed from the file for good.Search for text in a PDFCtrl+F across the whole document, then highlight or redact every match.Password protect a PDFLock a PDF with a password and AES-256 encryption, or restrict printing and copying.Unlock a PDFRemove the password and printing, copying or editing restrictions from a PDF.White out a PDFCover content with a white box and type over it.Reorder, rotate and delete PDF pagesReorder, rotate and delete pages; insert blank pages, other PDFs or images.Crop PDF pagesTrim white margins or keep just part of a page, on one page or all of them.Split a PDF into several filesCut a PDF at the pages you choose, every N pages or at each bookmark.Extract pages from a PDFPick pages by clicking them and save them as a new PDF.Merge PDF filesCombine PDFs and images into one file, in any order you like.Keyboard shortcuts and tipsUndo, copy and paste, select all, snap guides, layers and zoom.Compress a PDFMake a PDF smaller for email and upload limits while text stays sharp.Convert PDF to JPG or PNGSave PDF pages as high-resolution JPG or PNG images.Repair a damaged PDFOpen a corrupted or cut-off PDF and save a clean, working copy.