PDF tools

Text to PDF converter: type, paste or load a TXT file

Type or paste text, or load a UTF-8 TXT file, then choose the page size, font, margins and line spacing and create a PDF. This text to PDF converter runs in your browser. It embeds a DejaVu font so the text stays selectable, and it shows a preview of each page before you download.

Your text

Type, paste, or load a UTF-8 text file.

Plain text only · No account or upload

Page settings

Choose how your PDF should look.

Loading text editor…

How to convert text to PDF

To convert text to PDF, put the text in the editor, set up the page, then create and download the file. Changing the text or any setting afterwards clears the result, so the download always matches what you see.

  1. Type or paste into Text to convert, or select Load text file and pick a .txt file. The file's text replaces what is in the editor.
  2. Under Page settings, choose Page size (A4, US Letter, US Legal or A5), Orientation, Font, Font size (pt), Margins (mm), Line spacing and Alignment.
  3. Select Create PDF. The result shows the page count and file size, with a preview of the first page and Previous page and Next page buttons when there is more than one.
  4. Select Download PDF to save text.pdf, or Open PDF in a new tab to view it there.

Cancel stops a run and keeps your text. Reset clears the text and returns every setting to its default.

What the PDF keeps from your text

The PDF keeps the layout of plain text. Every space, blank line and line break stays where you typed it, and a tab becomes four spaces. Windows and old Mac line endings become ordinary line breaks, and a form-feed character starts a new page.

A line longer than the printable width wraps at the last space or hyphen that fits. A run with no space, such as a long URL, breaks between characters. Pages are added as the text fills each one, and the tool sets no page count limit.

As a worked example, 100 short lines at the default settings (A4 portrait, DejaVu Sans at 12 pt, 20 mm margins, line spacing 1.4) fill 3 pages, with 37 lines on each full page. US Letter holds 34 such lines, and line spacing 1 fits 52 on A4. For columns that must line up, choose DejaVu Sans Mono and Left alignment.

Fonts and characters

The PDF embeds the whole DejaVu Sans, DejaVu Serif or DejaVu Sans Mono font, so a PDF reader shows that font instead of a substitute. The text can be selected, searched and copied. The fonts cover Latin, Greek, Cyrillic and many symbols, and accented letters are normalized to Unicode NFC first.

When a character is missing from the chosen font, such as a Chinese character or some emoji, the tool stops and names its Unicode code point, for example U+4E2D. It does not drop the character without notice. Hebrew, Arabic and other right-to-left text also stop the run, as do combining marks with no precomposed form, because the tool cannot shape or reorder them.

This is plain-text conversion. Markdown and HTML appear as the literal characters you typed, with no headings, bold or links. The whole document uses one font, one size and one alignment.

Limits

The tool reads UTF-8 text only. A .txt file saved in another encoding, such as Windows-1252, is refused with a message to save it as UTF-8, and your current text is kept. A file with binary control characters is refused too. Word documents, RTF, ODT files and existing PDFs are not plain-text inputs.

Settings must leave room for text: a font size above zero, margins of zero or more and a line spacing of 1 or more. If the margins or the font are too large for the page, the tool asks for a smaller size or a larger page. It does not cut text off.

The tool sets no size cap of its own. A very long text is limited by the memory of your browser tab, and the browser can report that it cannot decode a very large file. The page needs JavaScript and Web Workers, and it loads the chosen DejaVu font file from this site each time you create a PDF.

Questions

How can I convert a text file to a PDF?

Select Load text file and pick the .txt file. Its text appears in the editor, where you can still change it. Choose the page settings, select Create PDF, check the preview, then select Download PDF. The tool reads UTF-8 files with or without a byte-order mark, and it saves the PDF as text.pdf.

Can I convert TXT to PDF without software?

Yes. This page builds the PDF inside your browser with the pdf-lib library, running in a Web Worker, so there is nothing to install and no account to create. It needs a browser that runs JavaScript and Web Workers. The only file the tool fetches while it works is the chosen DejaVu font, from this site.

How do I turn text into a PDF on my phone?

Open this page in the browser on your phone, paste the text into Text to convert and select Create PDF. On a narrow screen the editor, the settings and the preview stack in one column. Download PDF saves text.pdf through the download handling of your browser, and Open PDF in a new tab shows the file.

Can I convert TXT to PDF without losing formatting?

Yes, for plain-text formatting. Spaces, blank lines, line breaks and indentation stay as typed, tabs become four spaces and a form-feed character starts a new page. Choose DejaVu Sans Mono with Left alignment to keep columns lined up. A TXT file has no bold, italics, headings or colors, so the PDF has none either.

Can I convert a Notepad file to PDF?

Yes. Notepad saves plain .txt files, and this tool reads them when they are encoded as UTF-8. A file saved in an older encoding that holds accented letters or symbols is reported as not valid UTF-8, and your current text stays in the editor. Save the file again as UTF-8 in your text editor, then load it.

Is my text uploaded?

No. Reading a text file and making the PDF both happen in a Web Worker in your browser. Your text is not sent to a server or saved in browser storage, and the only file the tool fetches is the DejaVu font from this site. Reset clears the text and the PDF from the page.