Convert TXT to PDF in Your Browser

Convert .txt files to PDF with monospace formatting and exact line breaks preserved, entirely in your browser. Your text never leaves your device, and the tool keeps working offline.

Tap to select a file

Files are processed on your device only.

How it works

  1. Drop, paste, or select your .txt file. It is read on your device only.
  2. Choose page size, font size, and a light or dark theme.
  3. Click Print or Save as PDF, then pick your printer or PDF target.

Monospace layout and page breaks for long text files

Text is rendered in a fixed-width font, so anything that relies on space alignment (ASCII tables, log output, indented config) lines up exactly as written. Each line is wrapped individually, which means a page break always falls between two lines: a line is never cut through the middle, and long documents flow across as many pages as they need.

Lines longer than the page width wrap at the margin rather than clipping. For documents that need headings, tables, or highlighted code instead of flat text, the Markdown to PDF converter renders structure. You can read more about how browser-side rendering works.

Character encoding detection: UTF-8, UTF-16, and legacy code pages

The converter does not assume UTF-8. It first checks for a byte order mark, then validates the bytes as strict UTF-8. Files saved as UTF-16 (with a BOM, or detected by their NUL-byte pattern) decode correctly, and legacy code pages such as GBK and Windows-1252 are tried as a fallback when the bytes are not valid UTF-8.

When the encoding cannot be determined with confidence, the tool decodes with its best guess and shows a notice before you print, so mojibake never slips through silently. You can also paste text straight into the box above instead of selecting a file, which is handy for a quick snippet.

Frequently asked questions

Does this keep bold text, fonts, or images from my document?
No. A .txt file is plain text with no fonts, colors, tables, or images, so the PDF shows your text in a single monospace font. If your file actually uses Markdown syntax like # headings or fenced code, the Markdown to PDF tool renders those elements instead.
Which text encodings are supported?
UTF-8 is the default and is validated strictly. A UTF-8 or UTF-16 byte order mark is detected automatically, and common legacy encodings such as GBK and Windows-1252 are decoded as a fallback. If detection is uncertain, a notice appears before you print.
What happens to very long lines?
Long lines wrap at the page margin, so nothing is clipped off the right edge. Spacing and indentation are preserved, which keeps ASCII tables, logs, and aligned columns readable in the PDF.
Are my text files uploaded to a server?
No. Reading, decoding, and rendering all happen in your browser on your device. Nothing is sent to a server, there is no account, and the converter keeps working with your network disconnected.

Related tools