Convert TXT to PDF — free, in your browser, no signup
Updated
Plain text files are everywhere but PDFs are universal. SwissArmyPDF turns any .txt file (or pasted text) into a clean, paginated PDF with your choice of font, page size, and layout. All in your browser — no upload, no watermark.
When you need TXT → PDF
- Server logs. Share a snapshot with a teammate without sending a 10MB log file.
- Code snippets. Export source code for documentation or print.
- Configuration files. Archive an exact-state config in a non-editable format.
- Notes and journals. Plain-text journal entries packaged into a sharable PDF.
- Project Gutenberg books. Turn .txt downloads into readable PDFs.
- Email content archives. Pasted email text as a permanent record.
- Recipe and reference cards. Print-ready PDF from a plain text source.
How to convert TXT to PDF (step by step)
- Open TXT to PDF.
- Drop your .txt file or paste text directly.
- Pick a font family, size, page size, and orientation.
- Click Convert and download the PDF.
Pagination is automatic — long text wraps and breaks across pages.
Text encoding — what works
UTF-8 is fully supported. If your source file is in a different encoding (Windows-1252, ISO-8859-1, Shift-JIS), convert it to UTF-8 first:
- Mac/Linux:
iconv -f WINDOWS-1252 -t UTF-8 source.txt > out.txt - VS Code: bottom-right shows current encoding; click to "Save with encoding" → UTF-8.
- Notepad++: Encoding menu → Convert to UTF-8.
Without proper UTF-8, accented characters and non-Latin scripts appear as mojibake (… etc).
What's preserved (and what isn't)
- Spaces and tabs — preserved exactly. Use monospace fonts (JetBrains Mono, Courier) for code where alignment matters.
- Line breaks — preserved.
- Soft line wrap — long lines wrap automatically at the page edge.
- No formatting — plain text has no bold, italic, or color, so neither does the PDF output. For formatted text from .rtf or .md, use RTF to PDF or Markdown to PDF.
- No syntax highlighting — code blocks render in monospace but without color.
Tips for code-heavy text
- Pick a monospace font — JetBrains Mono or Courier preserve alignment for code, ASCII art, tables.
- Pick landscape orientation — code lines often exceed 80 characters; landscape avoids wrapping.
- Use a smaller font size (8–10pt) for long files to keep page count down.
- For syntax highlighting, paste the code into VS Code, export to HTML, then run through HTML to PDF — that's the cleanest path.
Troubleshooting
- Characters appear as boxes or mojibake. Source file isn't UTF-8. Re-save as UTF-8 first.
- Tab indentation collapsed. Use a monospace font and convert tabs to spaces (4 or 8) before importing.
- Long lines wrap awkwardly. Switch to landscape, smaller font, or pre-wrap the source.
- PDF is many pages from a short file. Check the font size — defaults are often too large for log output. Try 9pt.
Why local TXT-to-PDF matters
Plain-text files often contain things you wouldn't share: source code, server logs with internal hostnames or stack traces, config files with internal endpoints, personal journals. Uploading them to a web converter is a privacy hit. SwissArmyPDF runs conversion in your browser using pdf-lib. Nothing is uploaded; nothing is logged.
Common next steps
- Merge PDF — bundle with other PDFs (cover, attachments).
- Watermark PDF — mark as DRAFT or CONFIDENTIAL.
- Sign PDF — sign for sign-off.
- Markdown to PDF — if your source has any structure (headings, lists, code blocks), use markdown instead.