Code to PDF
Print source code to PDF with line numbers — paste any code snippet or upload a source file.
1. Upload your file
How does the Code to PDF work?
Print source code to PDF for a code review, a homework hand-in, a printed handout, or a regulatory archive. The output uses Courier (a fixed-width font) so indentation and alignment hold. Line numbers can be shown or hidden, and you can label the language at the top of the document. Tabs convert to four spaces; everything else is preserved as-is. Conversion runs in your browser — your code never leaves the device.
🔒 Security & Privacy
All processing happens on your device. Your files never leave your browser, never touch our servers, and are not stored anywhere. Close the tab and the file is gone.
📱 Use it on any device
Works in any modern browser — Mac, Windows, Linux, iPhone, Android, and tablets. No installation, no app to download. Just open the page and start.
⚡ Quick & easy
Drag, drop, click. Most files process in seconds, not minutes. No watermarks added to your output, no per-day limits, and the tool always shows the result before asking you to download.
🎁 Always free, no signup
Free to use, every time. No account creation, no email required, no “trial” that converts to a paid plan. We make money from ads so you don’t have to pay.
Frequently asked
Related PDF tools
More tools you might like
Hand-picked tools that pair well with this one — same audience, same intent.
Paste any plain text and download it as a clean, paginated PDF — preserves line breaks, no formatting needed.
Pretty-print a JSON file to PDF — useful for archiving API payloads, config dumps, or audit logs.
Convert a Markdown document (.md) to PDF — headings, bold/italic, lists, blockquotes, and fenced code all render correctly.
Extract all text from a PDF as a plain .txt file — great for search-and-replace, archiving, or copy-paste. Or output Markdown with detected headings (#/##/###).
Pull data out of a PDF as a CSV file — open in Excel, Google Sheets, or Numbers. Scanned PDFs are supported.
Pretty-print an XML file to PDF — handy for archiving SOAP payloads, sitemaps, configs, or RSS feeds.
Convert an HTML file to PDF — keeps headings, paragraphs, lists, blockquotes, and basic bold/italic. Lightweight, no upload.
A pull-request code review checklist — reviewer and PR details plus grouped checks for correctness, tests, performance, security, readability/docs, and a review decision.