Skip to content
Devtoolry

Text to PDF

Convert text or a .txt file to PDF online: choose the font, size, page size and margins, with word wrap and page numbers. Hindi works too; no upload.

Runs in your browser · Nothing uploadedFree · No sign-up

Something not working, or missing a feature? Send feedback

About the Text to PDF

Text to PDF sets plain text (notes, a .txt file, logs, code or a letter) on proper pages with margins, word wrapping and page numbers. The text stays real text in the PDF, so it can be searched and copied, and Hindi, Marathi and Nepali are typeset correctly.

PDFs are processed in your browser (pdf-lib, PDF.js and, for passwords, QPDF compiled to WebAssembly), so contracts, invoices and scans never leave your device.

How to use the Text to PDF

  1. Type or paste the text, drop a .txt file onto the box, or press Open .txt.
  2. Choose the font (Sans, Serif or Mono for code), the size and the margins.
  3. Pick A4 or US Letter, portrait or landscape, and whether to number the pages.
  4. Press Create PDF and download it.

Where it works well

  • Notes, letters and lists for printing or sharing
  • Logs and code listings in a monospaced font
  • Hindi or mixed Hindi–English text

Where it struggles

  • Formatting such as bold, headings or images (use Word to PDF, or Markdown to HTML then HTML to PDF)
  • Scripts other than Latin and Devanagari

Common mistakes

  • Long lines of code. Lines wider than the page wrap onto the next line. For wide code, choose landscape, a smaller size or Mono at 9 pt.
  • Emoji in the text. Standard PDF fonts have no emoji. Remove them, or the converter stops and names the first one it found.

Works well with the Text to PDF

Frequently asked questions

Is my file uploaded?

No. The PDF is made or read by your browser on your device, with pdf-lib and Mozilla's PDF.js. Nothing is sent to a server; the Network tab of the developer tools shows no request carrying your file.

Does Hindi work?

Yes. Devanagari text (Hindi, Marathi, Nepali, Sanskrit) is set with Noto Sans Devanagari, with matras and conjuncts joined as in a browser; English in the same line uses the font you chose. Other scripts such as Tamil, Bengali, Chinese and emoji show an error naming the character.

How do I start a new page?

Put a form feed character where the page should break: Ctrl+L in many text editors, or the page breaks that some programs write into exported .txt files.

Are tabs and indentation kept?

Yes. Tabs become spaces at every fourth column, and leading spaces are kept, so indented lists and code line up. Choose Mono so columns align exactly.

Which files can I open?

Any plain-text file up to 5 MB: .txt, .md, .csv, .log, .json, source code and so on. Word documents are not plain text; use Word to PDF for those.