Convert TXT to PDF
Three page layouts, and it works out whether your lines were wrapped by hand. Runs in your browser — nothing is uploaded.
- SECURE
- NO UPLOADS
- NO SIGNUP
- BROWSER BASED
- FREE
- FOREVER.
Support us with a link or a share
Drop a .txt file here
Nothing is uploaded. The file is read, laid out and written into a PDF in this tab.
Pasted text loses its line-ending info — drop the file if that matters.
The one question a txt to pdf converter has to answer
Plain text has no idea what a line is. Two files can hold identical sentences and disagree completely about where the newline characters sit, and neither of them is wrong. In the first, somebody — or their mail client, or a terminal, or a habit inherited from a machine with an eighty-column screen — ended every line by hand at around seventy characters. In the second, an entire section sits on a single line thousands of characters long, and the software that displayed it folded that line to fit whatever window it happened to be in.
Those two files must be treated differently, and almost nothing that turns text into a document bothers to look. Print the first as though each newline began a new paragraph and you get a column with a ragged left-hand edge and a fresh indent every six or seven words, which is unreadable in a way that is hard to name but immediately obvious. Refuse to re-flow the second and the sentences run straight off the right margin, or arrive at one line per page. Getting this backwards is the single most common reason a converted text file comes out looking broken.
So this page works it out before it lays anything down, and then tells you what it concluded and how sure it is. The test follows from what wrapping actually is: software that folds a paragraph fills each line until the next word will not fit. That means in a genuinely hand-wrapped file it holds for practically every line that the first word of the line beneath it would have overflowed. It is a definition rather than a correlation, so the proportion sits close to one. In a log, where line lengths are whatever the messages happened to be, plenty of short lines had room to spare and the proportion collapses. Whichever answer comes back, the two buttons above let you overrule it — detection with no control attached is just a quieter guess.
Plain text and PDF, in brief
| Full name | Plain text file |
|---|---|
| Extension |
.txt
|
| Format type | Unformatted text |
| MIME type |
text/plain
|
| Full name | Portable Document Format |
|---|---|
| Extension |
.pdf
|
| Format type | Fixed-layout document |
| MIME type |
application/pdf
|
Text to PDF, when the text is not in a file yet
A good share of the people who need this never had a file to begin with. The material is
sitting in a terminal window, a chat log, a notes app, a support ticket, an email nobody
wants to forward. So the box for pasting stands beside the drop target as an equal, not
hidden behind it, and it produces exactly the same document by exactly the same route.
When the source is the original .eml file and its headers and attachment
inventory matter, use the EML to PDF converter instead.
There is one difference, and it is worth stating rather than papering over. A text area in a web browser rewrites Windows-style line endings to plain ones before any code on the page is allowed to see the content. That behavior is written into the HTML specification and cannot be worked around by anyone. Anything this tool might tell you about line endings or about how the material was wrapped would therefore be an invention for pasted text, so it says unknown instead and hands the wrapping decision to you. If that distinction matters to what you are doing, drop the file itself.
Three layouts that differ in more than a color
Formal is a report: inch margins, Times, a rule under a running header carrying the file name, and Page 3 of 12 centered at the foot. Light opens the leading right up and puts noticeably fewer words on each sheet, which is what you want when the destination is a screen and nobody is going to print it. Compact pulls the margins in to half an inch, drops to nine and a half points and closes the gaps between paragraphs, on the theory that a four-hundred-page log becomes a different object at two hundred and forty.
Every one of those measurements is a starting point and none of them is a ceiling. Type size, margin, typeface, page numbers and the header are all separately adjustable afterwards, and adjusting one does not silently drag you back to a preset. The label simply reads adjusted until you press the template again on purpose.
What a plain text file quietly carries
Less than a word processor, more than nothing, and the difference matters. A blank line is a paragraph boundary — the one structural convention every reader of plain text agrees on. Leading spaces are meaning, not decoration: flatten them and a directory listing, a stack trace or an indented block of code stops being legible. In Keep every line mode those lines therefore use fixed-width text: every repeated space remains a column, with no code-style background. Tabs land on real tab stops, eight columns apart by default and adjustable when the file contains any, because a tab replaced by a single space slides an entire column out of alignment.
And the form feed, character twelve, still means what it has meant since line printers: the page ends here. Files exported from mainframes, accounting systems and older report generators are full of them, and every one becomes an actual page break rather than an invisible character that quietly vanishes.
Headings are the thing plain text genuinely cannot express, and guessing at them from capital letters produces confident, eighteen-point mistakes. The optional formatting step exists for that instead: it opens the same editing surface used by the Markdown editor and runs the result through the same layout code as Markdown to PDF, so a heading you add here is identical to a heading added there. Going the other direction — pulling words back out of a finished document — is a genuinely harder problem and lives at PDF to text.
Encoding, and why your file may be full of å
A file extension of .txt tells you nothing at all about which bytes stand for which characters. Text saved out of Notepad on a Western European Windows machine is very often Windows-1252; text out of a modern editor is UTF-8; text out of PowerShell is frequently UTF-16 with a byte order mark at the front. Read one as another and every accented letter turns into a small pile of punctuation. The bytes are examined here before anything is laid out, the answer is displayed, and it can be overridden — necessary because a Latin-1 file can be perfectly valid UTF-8 as well, and in that case only a human looking at the words can tell which reading is the right one. The wider subject is covered in UTF-8 versus ASCII.
Getting the encoding right still leaves one trap, and it is the reason a file written on
a Mac used to come out worse than the same file written on Windows. Unicode lets an
accented letter be spelled two different ways: é can be one character, or it can
be a plain e followed by an invisible accent that sits on top of it. Both are
correct, they look identical on screen, and macOS has historically written the second
form. The built-in PDF fonts only have the first, so a résumé written on a Mac arrived as
re?sume? while the same word from Windows was fine.
So the two spellings are unified before anything is laid out, which turns the second back into the first. The practical effect is that French, Swedish, German, Spanish and Portuguese text now comes out right with no font download at all — the letters were always inside those fourteen fonts, and only the spelling was in the way. Accents that genuinely have no single-character form are counted and named before layout. No PDF is made until those marks are removed or the text is taken to an editor with the shaping support they require; this tool never turns them into question marks.
Cyrillic, Greek and box-drawing characters, and what a PDF can hold
The PDF format has fourteen fonts built into every reader on earth, which is why a file made from them opens anywhere and weighs almost nothing. The price is that those fourteen cover Latin-1 and no more. A Russian word, a Greek letter, a Polish ł, a Vietnamese ế, or the box-drawing characters that a directory listing is made of — none of them exist in those fonts, and a converter that hands the text straight to the PDF library either crashes or drops the characters without saying so.
Here they are counted first and named. If they are characters a real font can draw, the tool offers to embed one — DejaVu Sans, a free typeface under the Bitstream Vera license, served from this site and never from a font CDN. It is fetched only when you press the button, only when it would actually help, and the download is 739 KB, which is written on the button before anything happens. Only the glyphs your document uses are written into the PDF, so a two-page letter in Russian comes out around fifty kilobytes rather than seven hundred, and the text stays selectable, searchable and copyable.
Three things stop the job before layout, said plainly rather than discovered in a damaged download. Chinese, Japanese and Korean need a much larger font than the one available here. Color emoji need a different rendering path. Arabic and Hebrew need the line to be reordered and the letters reshaped according to their neighbors; this tool does neither. In each case the page names the characters it cannot render and makes no preview or PDF with them in it. One button removes exactly those characters, and the receipt lists what went; nothing is swapped for a question mark. For the full text, use an editor with the necessary fonts and shaping support. A named removal is safer than a polished document whose text has silently changed.
Nothing is uploaded, including the very large ones
No route on this site accepts a document from this page. The bytes are decoded, measured, paginated and assembled into a PDF by code running in the tab you have open, and the download button points at something that never existed outside your own memory. The method for checking that claim yourself, rather than believing it, is written up in how to verify a tool runs locally.
Size is not a reason to be turned away either. A twenty megabyte server log is a thing people genuinely have, and it becomes thousands of pages, so the work is done in slices with the browser handed back control between each one and a counter that reports pages actually finished rather than a bar that guesses. What you get beforehand is an honest warning about what the job will cost your machine, followed by the job.
The same slicing carries a much larger job on the next page over. An ebook is text too, only wrapped in an archive with its chapters in separate files, and the EPUB to PDF converter feeds them through this identical layout code one chapter at a time — with the counter reporting chapters finished, for the same reason it reports pages here.
Questions
How do I turn a TXT file into a PDF?
Drop the file on the counter above, or paste the text straight in. The tool reads it, tells you how many pages it will make, and writes the PDF when you press the button. Nothing is installed and nothing is sent anywhere — the conversion happens in this tab, which is the part Adobe's own instructions for this cannot offer, because they begin by asking you to open Acrobat.
Why does my text come out ragged in other converters?
Because a plain text file can be wrapped two different ways and most tools never look. In a hard-wrapped file every line was ended by hand at around seventy characters, so treating each line as its own paragraph produces a broken, uneven column. In a soft-wrapped file a whole paragraph sits on one long line, and a tool that refuses to re-wrap runs it off the edge of the page. This one works out which kind you handed in, says so, and lets you overrule it.
Can I paste my text instead of opening a file?
Yes, and the box is right there in the empty state rather than hidden behind the file picker. One honest limitation: a text box in a browser rewrites Windows line endings to plain ones before any script can see them, so for pasted text the line endings are reported as unknown and the wrapping choice is left to you instead of being guessed at.
What happens to tabs, indentation and page breaks?
All three survive. In Keep every line mode the text uses a fixed-width face, so leading spaces and repeated spaces remain real columns instead of collapsing. Tabs expand to the selected tab stops, and a form feed character — the thing that has meant "page ends here" since line printers — becomes an actual page break. What plain text cannot carry is headings, and rather than guess at them from capital letters the tool offers a formatting step where you add them yourself.
What is the best text to PDF converter?
The useful question is narrower than it sounds, because almost all of them produce a valid PDF. What separates them is whether they read your line breaks correctly, whether they let you see the page count before you commit, whether the layout is adjustable afterwards, and whether your file leaves your machine. Those are the four things to check on any of them, including this one.
Is my file uploaded?
No, and this site runs nothing a document could travel to — no staging area, no work queue, no cache holding it for a while. Your text is decoded, measured, wrapped and typeset by code running in front of you, and the download button hands back something your own browser assembled. That is worth stating for pasted text as firmly as for files, because the box invites pasting: a paragraph typed into it travels exactly as far as a file dropped on it, which is not at all.