Convert a TXT file to PDF

Drop a .txt file and get a paginated PDF, made on your device.

Converts a .txt file to a PDF with the page size and margins you choose, wrapping long lines and adding page numbers. It is free, needs no account and adds no watermark, and your file is not uploaded: it is laid out by code in this tab. Chinese, Japanese, Korean, Arabic, Hebrew, Thai and emoji cannot be drawn, and the result tells you when a file had them.

Drop a TXT fileor click to choose files. Batches welcome.
    Details

    Plain text only: Markdown is not formatted, a CSV is not turned into a table, and there are no pictures, bold or italics. Tabs become four spaces and a form-feed character starts a new page.

    Monospace is picked automatically for .csv and .log files and for text with columns lined up with spaces. Pick Sans-serif or Monospace to override it.

    Chinese, Japanese, Korean, Arabic, Hebrew, Thai, Indian scripts and emoji cannot be drawn. Each shows as � and the result says how many. Files up to 2 MB, about 300 pages.

    Working…

    Done

    Free, no ads. Support StayPut

    Your files are processed on this device and never sent to a server. Reload the page to clear everything from memory.

    A .txt file is the simplest document there is, which makes it awkward to print or send to someone who wants a PDF: it has no page size and no margins, and every program wraps it differently. Converting it fixes both.

    Worked example. You have notes.txt saved from Notepad with the encoding set to "Unicode". Drop it, pick A4 or US Letter and press Convert to PDF. Long lines wrap at the margin, tabs become four spaces, blank lines stay, and page numbers are added at the bottom. Notepad’s "Unicode" files (UTF-16) and older Windows files in Western European encoding are read correctly, and the result says when it had to read a file as Western European.

    The file is converted in your browser tab. It is not uploaded, and there is no account.

    This page reads plain text only. For text you would rather paste, or a CSV or log file with aligned columns, use Text to PDF, which has a paste box and a monospace font.

    How it works

    1. Drop a .txt file.
    2. Choose A4 or US Letter, margins and type size.
    3. Press Convert to PDF and save it.

    In your browser, not on a server

    Your browser reads the text, works out its encoding (UTF-8, UTF-16 or Western European), expands tabs and splits it into lines. pdfmake (MIT, built on PDFKit) breaks the lines into pages in a background worker and embeds the Roboto font and a subset of DejaVu Sans Mono for monospace text and symbols. The PDF is written in your tab.

    Compared with upload-based tools: Your text goes from the box straight into a PDF made on this device, so a note, a draft or a log file is not sent to a server, and nothing is added to the page.

    Verify it yourself. Give the page a short while after one visit to save itself for offline use, then turn off Wi-Fi or switch to airplane mode and run the tool again. Or open your browser's developer tools (F12, or Cmd-Option-I on a Mac), pick the Network tab, and watch it while you convert. The panel above does the same count for you.

    Questions

    How do I convert a TXT file to PDF?

    Drop the .txt file on this page, choose A4 or US Letter and press Convert to PDF. The text is wrapped to the page, numbered and written as a PDF with the same name and a .pdf ending.

    Is my file uploaded?

    No. The file is read from your disk and the PDF is written in this tab, so a note, a draft or a log does not leave your device. After one visit and a short wait the page works offline.

    Why is part of my text shown as a � mark?

    The built-in fonts cannot draw Chinese, Japanese, Korean, Arabic, Hebrew, Thai, Indian scripts or emoji. Those characters are replaced by � and counted in the result, so you can see what was affected. For a file that is mostly in one of those scripts, open it in your browser and use Print, then Save as PDF, which uses your device’s own fonts.

    What if the file shows odd characters like é in the PDF?

    That happens when a UTF-8 file is read as Western European text, or the other way round. Open the options, set Text encoding to UTF-8 or to Western European, and convert again.

    How big a file can I convert?

    Up to 2 MB of text per file, which is about 300 pages. A PDF is laid out in your device’s memory, and larger files can make a tab run out of it, so split bigger files into parts.

    More PDF tools

    Other conversions