How to Convert Text to PDF Online
The fastest way to convert text to PDF online is to paste it into a text-to-PDF maker, choose a readable font and page size, then download and inspect the result. For more control over headings, links, page numbers, and spacing, paste the text into Word or Google Docs before exporting it as a PDF.
The right method depends on what your source actually contains. Plain text needs basic layout; formatted text may include headings and links; Markdown needs a renderer that understands symbols such as #, **, and lists. This guide covers all three cases without requiring specialist PDF software.
Choose Between Plain Text, Formatted Text, and Markdown
Before choosing a converter, identify your source format:
| Source | What it contains | Best workflow |
|---|---|---|
Plain text or .txt | Characters and line breaks, but no fonts or layout | Online text-to-PDF maker |
| Formatted text | Headings, bold text, links, tables, or images | Word or Google Docs |
Markdown or .md | Plain text plus formatting syntax | Markdown editor with PDF export or browser print |
A .txt file does not store a font, margin, paper size, header, or page number. The converter creates those layout choices, so the same text can paginate differently in two tools.
If you only need a clean, shareable reading copy, start with a dedicated text-to-PDF maker. If the PDF must look like a report, proposal, handout, or branded document, use a document editor instead.
Method 1: Use an Online Text-to-PDF Maker
An online text-to-PDF maker is the shortest route for notes, instructions, transcripts, code snippets, and other simple content.
- Open a reputable text-to-PDF maker in your browser.
- Paste your text into its editor, or upload a
.txtfile if uploads are supported. - Choose the page size, orientation, margins, font, font size, and line spacing.
- Preview the pages and look for awkward page breaks or clipped lines.
- Generate the PDF and download it to your device.
- Open the downloaded file and verify the text, page count, and selectable characters.
Before uploading a .txt file, open it in a text editor and confirm that every character displays correctly. If you see replacement symbols such as �, the file may be using the wrong character encoding. Resave it as UTF-8 and try again.
A simple maker is convenient, but check what it can actually preserve. Pasting content from a website may bring hidden formatting into a rich-text editor, while a plain-text box may remove bold text, links, tables, and images. If those elements matter, use the next method.
Method 2: Paste Text into Word or Google Docs
Word and Google Docs are better choices when the PDF needs a title, headings, clickable links, page numbers, headers, tables, or deliberate page breaks.
Convert text with Microsoft Word
- Create a blank Word document.
- Paste the text using Keep Text Only if you want to remove formatting copied from another source.
- Apply heading styles, set the font, and adjust paragraph spacing.
- Choose the correct paper size and margins under the layout settings.
- Add page numbers, headers, or footers if needed.
- Select File > Save As or File > Export, choose PDF, and save a separate copy.
For a more detailed export checklist, see How to Save a Word Document as a PDF: 5 Reliable Methods.
If you create a .doc or .docx file but do not have Word available for the final conversion, DeckFlow Word to PDF can handle that Word file in a browser. It does not accept raw .txt content, so you must create and save the Word document first.
Convert text with Google Docs
- Create a blank Google Doc and paste the text.
- Apply headings and paragraph styles instead of formatting each line manually.
- Select File > Page setup to check the page size, orientation, margins, and page color.
- Add page numbers, headers, footers, or links as needed.
- Select File > Download > PDF Document (.pdf).
- Open the downloaded PDF and inspect every page.
Google’s help documentation also recommends using File > Print and choosing Save as PDF for a particularly large Google Doc. The normal download command is the clearer default for most documents.
Keep the .docx or Google Doc so you can correct the content and export a new PDF later.
Method 3: Use Browser Print to PDF
Browser printing works well when the text already appears on a clean webpage, in a browser-based editor, or in a rendered Markdown preview.
- Open the page or preview that contains the text.
- Press Ctrl+P on Windows or Linux, or Command+P on Mac.
- Choose Save as PDF as the printer or destination.
- Set the page range, paper size, orientation, margins, scale, and background graphics.
- Check the preview for cut-off content, empty pages, menus, cookie banners, or unwanted headers and footers.
- Save the PDF and review it outside the browser.
This method prints the visible presentation and may include navigation, dates, or URLs. Use a reader view or distraction-free editor when possible.
For Markdown, open the .md file in an editor that provides a rendered preview. Print the preview, not the raw Markdown source, unless you intentionally want symbols such as ## and ** to appear in the PDF. Check fenced code blocks and long URLs carefully because they can extend beyond the page boundary.
Set Fonts, Margins, Page Size, and Line Spacing
Good PDF output depends more on a few consistent layout decisions than on decorative formatting.
- Font: Use a readable font that contains every character in the document. Avoid mixing many typefaces.
- Font size: Around 10–12 points is a practical range for normal body text. Use larger sizes for headings.
- Line spacing: Start around 1.15–1.5 for prose. Dense logs or code may need a smaller value and a monospaced font.
- Margins: Moderate margins improve readability and leave room for printing. Narrow margins can make long lines tiring to read.
- Page size: Choose A4 or US Letter based on the recipient’s region and printing needs. Changing the size changes pagination.
- Paragraph spacing: Use space after paragraphs instead of adding repeated blank lines. It produces more predictable page breaks.
Use real heading styles when an editor supports them. Styles keep the hierarchy consistent and can improve accessibility. Also check text contrast, link labels, reading order, and whether the PDF contains searchable text rather than page images.
Preserve Chinese and Other Unicode Characters
Chinese, Japanese, Arabic, accented Latin characters, emoji, and mathematical symbols require both correct encoding and a font that includes the necessary glyphs.
Use UTF-8 for plain-text files whenever possible. Then choose a Unicode-capable font with coverage for the languages in your document. If the selected font lacks a character, the converter may substitute another font or display a blank box.
After conversion, search for a distinctive non-Latin word in the PDF and copy it into a text editor. Also inspect line wrapping, punctuation, and text direction; a PDF can look correct while still breaking Arabic directionality or East Asian punctuation.
If characters are missing, first resave the source as UTF-8, then switch to a font with the right language coverage and export again. Turning the text into an image may hide the encoding problem, but it makes the result harder to search, select, copy, and access with a screen reader.
Review Privacy Before Pasting Sensitive Text
An online converter may need to send your text or file to a remote service for processing. Before pasting contracts, personal data, credentials, medical information, unpublished work, or confidential client content, review the service’s privacy policy and retention terms.
Ask four practical questions:
- Is the conversion performed locally in the browser or on a remote server?
- How long are the source and output files retained?
- Is uploaded content used for analytics, service improvement, or model training?
- Can the provider meet your organization’s security and compliance requirements?
When the answers are unclear or external uploads are prohibited, use a trusted local text editor, Word desktop, or your operating system’s print-to-PDF function. Also remove passwords, API keys, private notes, and tracked changes that do not belong in the final document.
Check the PDF Before Sharing
Do not treat a successful download as proof of a successful conversion. Open the PDF and check:
- The first and last lines are present.
- Paragraphs and page breaks appear in sensible places.
- Chinese and other special characters display correctly.
- Links work and point to the intended destinations.
- Page numbers, headers, and footers are consistent.
- No editing comments, browser controls, or private metadata are visible.
- Text can be selected and searched when accessibility matters.
For a long document, compare the source and PDF page by page or use a few distinctive phrases to spot-check the beginning, middle, and end.
Frequently Asked Questions
Can I convert a TXT file directly to PDF?
Yes. Use a text-to-PDF maker that accepts .txt uploads, or open the file in a text editor and print it to PDF. Because TXT stores no page layout, choose the font, margins, paper size, and line spacing during conversion.
Will links remain clickable in the PDF?
They can, but the result depends on the workflow. Word and Google Docs can export hyperlinks, while a plain-text converter may treat URLs as ordinary characters. Click every important link in the final PDF before sharing it.
How do I add page numbers to a text PDF?
Paste the text into Word, Google Docs, or another document editor, then use its page-number feature before exporting. Some text-to-PDF makers also offer headers and footers, but the controls vary.
Can I convert text to PDF on a phone?
Yes. Paste the text into a mobile document app and export or print it as PDF, or use a browser-based text-to-PDF maker. Save the result to the device’s file manager and inspect it before sending.
Why does the PDF show boxes or question marks instead of characters?
The source may use the wrong encoding, or the selected font may not contain those characters. Resave plain text as UTF-8, choose a font with the required language coverage, and convert it again.
Related Reading
- How to Save a Word Document as a PDF: 5 Reliable Methods — Compare native and browser-based Word export workflows.
- Word to PDF with the Same Fonts and Formatting — Prevent font substitution and unexpected layout changes.
- Convert Word to PDF Online with DeckFlow — Convert a
.docor.docxfile after formatting your text in Word.