# Text to PDF

> A free online tool that puts plain text from a paste or a text file into a PDF while keeping line breaks and blank lines.

Convert text to PDF by pasting your text or opening a .txt file. The tool keeps your line breaks and blank lines, and you choose the font, text size, line spacing and page size. Anonymous use needs a short human check. Signed-in users skip the check and use credits.

## Key facts

- Input: pasted text or a .txt, .text, .log or .csv file up to 2 MB.
- Options: sans-serif, serif or monospace font, 8 to 16 pt text, three line spacings, page size, margin and landscape.
- Plain text only: no bold, headings or links. Non-Latin text prints when a server font covers the script.
- Free without an account: up to 10 conversions per minute and 50 per day per visitor, no watermark. Signed in, each render costs 1 credit (100 free credits every month).
- Files are deleted automatically: 10 minutes after conversion without an account, 1 day with a free account.
- Developers can run the same render with POST https://api.aiipworld.com/v1/render and an API key (see the PDF API page).

## How it works

1. Paste your text into the box, or open a .txt, .text, .log or .csv file from your computer.
2. Choose a font: Sans-serif, Serif or Monospace.
3. Set the text size from 8 to 16 pt, the line spacing, the page size and the margin. Choose landscape if you need a wider page.
4. Complete the human check if you are not signed in, then press the convert button.
5. Check the PDF and download it.

## How to convert text to PDF

You can convert text to PDF in your browser, with no software to install. Paste your text into the box, or open a file from your computer. The file is read in your browser first, and then the text is sent to the render server to make the PDF.

We add no watermark to the PDF. Results are deleted after 10 minutes, and no history of your conversions is kept.

## Fonts, size and spacing

Choose one of three fonts: Sans-serif, Serif or Monospace. Sans-serif uses Liberation Sans, Serif uses Liberation Serif, and Monospace uses Liberation Mono, where every character has the same width.

Set the text size between 8 and 16 pt. Line spacing has three choices: tight, normal and loose. Tight fits more lines on a page, and loose leaves more space between lines.

The fonts come from the render server. Fonts installed on your own computer are not available to the tool, so the PDF can look different from the text in your editor.

## Line breaks and long lines

Line breaks, blank lines and repeated spaces are kept as you typed them. Tab stops are four characters wide, so tabbed text lines up in the same way on each line.

Long lines wrap to the page width, so you do not need to add line breaks by hand to make the text fit. Landscape gives you a wider line length for long lines of log output or code.

## Languages and special characters

The render server has several script families. Noto Sans CJK covers Simplified and Traditional Chinese, Japanese, Korean and Hong Kong Chinese. Noto fonts also cover Arabic, Hebrew, Devanagari, Bengali, Thai, Georgian, Armenian and Ethiopic.

Emoji are drawn with Noto Color Emoji. Liberation Mono covers Latin, Greek and Cyrillic in the Monospace font.

A character that no server font covers may not print correctly. If you mix Chinese with Latin text, choose Sans-serif or Serif rather than Monospace, because the Chinese characters do not line up on the monospace grid.

## TXT file or pasted text

You can paste text or open a file with the extension .txt, .text, .log or .csv. Both routes use the same options and produce the same kind of output.

The file is read in your browser, and files that are too large are not opened. The text tool prints the file as plain text, one line after another.

For a table saved as CSV, use the CSV to PDF tool instead. It prints the rows as a table, and the header row repeats on every page.

## Plain text, Markdown or HTML

The text tool treats everything as plain text. Bold markers, headings and links are not turned into formatting, so they print exactly as you typed them.

If you need headings, bold text, tables or links, use the Markdown to PDF tool. It supports tables, task lists, strikethrough and code blocks with colours for many languages. If you already have HTML, use the HTML to PDF tool.

## Text to PDF from code

You can make the same kind of PDF from your own code with the API. Send your text inside HTML in a request to the html_to_pdf operation, and send your API key as a Bearer token in the Authorization header.

A request returns 202 with a job_id. Poll GET /v1/jobs/:id until the status is succeeded, failed or timeout, then download the file from download_url. The download link is short-lived, so fetch the file soon after the job succeeds.

Credits for failed and timed-out jobs are returned. Webhooks are not available yet, so polling is the way to find out when a job is done. There is no batch endpoint, so send one request per document.

## Converting a text file or pasted text

Use this as a txt to pdf converter for notes, logs or a plain list you want to print. Open the .txt file or paste its contents.

A text file to pdf conversion uses the same options as pasted text, so you can switch between the two without changing your settings.

If you want a text to pdf converter that keeps every line break and blank line as you typed them, this tool does that. Lines are not reflowed into paragraphs.

## Generate PDF from text for printing

To generate pdf from text for a quick printout, such as a draft or a set of notes, paste the text, pick a font and text size, and convert. Then print the downloaded file from your own computer.

## Questions

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

Open the .txt file with the tool, or paste its contents into the box. Choose your font, size and page size, complete the human check if you are not signed in, and convert the file. The PDF keeps the line breaks from your file.

### Can I choose the font?

Yes. You can choose Sans-serif, Serif or Monospace. These map to Liberation Sans, Liberation Serif and Liberation Mono on the render server. Fonts on your own computer are not available.

### Are line breaks kept?

Yes. Line breaks, blank lines and repeated spaces are kept. Long lines wrap to the page width, and tab stops are four characters wide.

### Does it work with Chinese, Arabic or emoji?

Yes, for characters that a server font covers. Noto Sans CJK covers Chinese, Japanese and Korean, Noto fonts cover Arabic, and emoji use Noto Color Emoji. A character that no server font covers may not print correctly.

### How do I change the page size?

Pick a page size from the options before you convert. You can also set the margin, and choose landscape to make the page wider than it is tall. These options apply to the whole document.

### Can I make a text file into a PDF on my phone?

The tool needs no app and no install. It runs in a browser tab, so there is nothing to download first. Use the same steps as on a computer, and check the PDF before you rely on it.

### Can I add page numbers?

Not in the web tool for text. The API supports header and footer templates, where the pageNumber and totalPages spans print page numbers. Leave room in the margin for the footer.

### How many pages can I print?

The free tool prints up to 10 pages per conversion. For longer documents, split the text into several files and convert each one. The API has no batch endpoint, so send one request per document.

### Is there a file size limit?

Yes. Files that are too large are not opened in the browser. The text is turned into HTML for the render server, and that HTML must fit within 256 KB per conversion.

### How long is the PDF kept?

Results are deleted after 10 minutes. No history of your conversions is kept, so save the PDF to your own computer when it is ready.

### Is my text sent to a server?

Yes. The file is read in your browser, then the text is sent to our render server, which makes the PDF. Each job renders in a fresh browser context inside a resource-limited worker container, with a hard time limit.

### Does the PDF have a watermark?

No. We add no watermark to the PDF. Anonymous use needs a human check, and signed-in users skip that check and use credits.

### How do I change a text document to a PDF?

Open a .txt, .text, .log or .csv file, or paste the text into the box. Choose the font, text size and page size, complete the human check if you are not signed in, and press convert. Other file types are not opened, so copy the text from them and paste it in.

### How do I save text as a PDF?

Paste the text into the box or open a text file, then press convert. The PDF keeps your line breaks, and long lines wrap to the page width. Download the file when it is ready, because results are deleted after 10 minutes.

### Can I convert a log file to PDF?

Yes. Open a .log file and the tool prints it as plain text, one line after another. For long log lines, choose landscape to give each line more width.

## Related

- [Markdown to PDF](https://aiipworld.com/tools/markdown-to-pdf/index.md)
- [HTML to PDF converter](https://aiipworld.com/tools/html-to-pdf/index.md)
- [CSV to PDF](https://aiipworld.com/tools/csv-to-pdf/index.md)
- [JSON to PDF](https://aiipworld.com/tools/json-to-pdf/index.md)
- [PDF API](https://aiipworld.com/pdf-api/index.md)
- [HTML to Markdown](https://aiipworld.com/tools/html-to-markdown/index.md)

Page: https://aiipworld.com/tools/text-to-pdf/
