# Text to PDF

> Turn pasted text or a .txt file into a clean, paginated PDF. Runs entirely in your browser — nothing is uploaded.

Source: https://toffeekit.com/tools/text-to-pdf

**Category:** [PDF](https://toffeekit.com/category/pdf) · **Price:** Free · **Runs:** in your browser, nothing is uploaded

Open the tool: https://toffeekit.com/tools/text-to-pdf

**Also useful for:** txt to pdf, text to pdf, notepad to pdf, code to pdf, log to pdf

## What you can do

- **Save notes as a PDF** — Easy-to-read sans text with comfortable spacing. ([open with this preset](https://toffeekit.com/tools/text-to-pdf?preset=notes))
- **Print source code** — Monospace with line numbers and the file name on every page. ([open with this preset](https://toffeekit.com/tools/text-to-pdf?preset=code))
- **Archive a log file** — Small monospace text on landscape pages, so long lines fit. ([open with this preset](https://toffeekit.com/tools/text-to-pdf?preset=log))
- **Format a letter** — Serif text with wide margins, like a printed letter. ([open with this preset](https://toffeekit.com/tools/text-to-pdf?preset=letter))

## How it works

1. Paste text into the box, or click Open file to load a .txt, .md, .csv, .log or code file.
2. Pick the page Size, Orientation and Margins, then the Font, Font size and Line spacing.
3. Turn on Line numbers, Page numbers or File name at the top if you want them, and check the preview.
4. Click Create PDF to download it.

## FAQ

### How do I convert a TXT file to PDF?

Click Open file and choose the .txt file, or drop it on the text box. Adjust the page options and click Create PDF.

### Will my spacing and indentation be kept?

Yes. Spaces, blank lines and indents are kept as typed, and tabs line up to the tab width you choose. The Mono font keeps columns aligned exactly.

### What happens to long lines?

They wrap at the page margin, breaking between words. Wrapped lines keep the original indent, so code and lists stay readable.

### Is the text in the PDF selectable?

Yes, for Latin-alphabet text, which is written as real text you can search and copy. Text in other scripts, such as Chinese or Arabic, is drawn as sharp page images instead.

### Can I convert code to PDF with line numbers?

Yes. Choose the Print source code preset, or turn on Line numbers. Only the first line of a wrapped line gets a number, like in a code editor.

### Is Text to PDF free and private?

Yes. It's free with no sign-up or limits, and it runs entirely in your browser, so your files are processed on your device and never uploaded. It works on phones and computers alike.

## Privacy

Text to PDF runs entirely in your browser. Your files and text are processed on your device and are never uploaded.

## Related tools

- [Merge PDF](https://toffeekit.com/tools/merge-pdf) — Combine several PDFs into one, in any order.
- [Split PDF](https://toffeekit.com/tools/split-pdf) — Split by every page, every N pages or custom ranges.
- [Organize PDF](https://toffeekit.com/tools/organize-pdf) — Drag to reorder, rotate and remove pages.
- [Extract Pages](https://toffeekit.com/tools/extract-pdf-pages) — Pull selected pages into a new PDF.
- [Delete Pages](https://toffeekit.com/tools/delete-pdf-pages) — Remove pages you don't need.
- [Rotate PDF](https://toffeekit.com/tools/rotate-pdf) — Rotate all pages or just the ones you pick.

