What is a .txt file, and what changes when it becomes a PDF?
A .txt file is text and nothing else. No fonts, no margins, no bold, no page size. The only formatting it carries is where the characters sit — which column each one starts in, and where the lines break. For a shopping list that hardly matters. For a server log, a code listing, a directory tree or a column of numbers, it is the entire point: the file reads correctly because every character takes the same width, so column 12 on line 1 sits directly above column 12 on line 40.
A PDF is the opposite kind of document. It is a fixed description of marks on a page: this character, in this font, at this coordinate, on a page this size. It does not reflow when the window changes. That fixity is why people convert text to PDF: you want it to arrive looking the way it left, print on one known paper size, and open on a machine with no text editor you trust.
So the conversion has one real job, and it is a layout job: take a stream of characters with no page in mind and decide where each one lands on paper, without breaking the alignment that made the file readable. The TXT to PDF converter does that in your browser — it measures the page, expands tabs to real stops, honours form feeds as page breaks, wraps anything too long, and writes the result out as characters rather than as a picture.
How the TXT to PDF conversion works
The whole layout rests on one property of monospace type. In a fixed-pitch font every character — the i, the W, the space — advances the cursor by the same distance. The tool draws in Courier, whose glyphs each advance 0.6 of the font size. That means a line's width can be calculated instead of measured, and the number of characters that fit across a page is a division.
columns per line = (page width − both margins) ÷ (font size × 0.6) — on A4 portrait with 20 mm margins, that is 170 mm of usable width divided by the 2.33 mm an 11 pt Courier character occupies. The answer is 73 characters, and that is exactly what the page reports.
Line count works the same way downward. Line height is the font size times the line spacing, so at 11 pt and 1.35 × spacing each line takes 5.24 mm, and 257 mm of usable height holds 49 of them. Those two numbers — 73 columns and 49 lines — define the grid every character drops into.
The second half of the job is what gets written. The characters go into the PDF through its text operator, not onto a canvas that is then pasted in as an image. The difference shows up the moment you try to use the file. Build a six-page PDF from 3,000 words of prose and the phrase you typed is sitting in the file's bytes verbatim — searchable, selectable, copyable, readable by a screen reader, and about 46 KB on disk. The same six pages rendered as pictures would run into the megabytes and answer no search at all.
How much text fits on one page
Every setting on the page moves the same two numbers: how many characters fit across a line, and how many lines fit down the page. Here is what each paper size gives you at the default 11 pt, 20 mm margins and 1.35 × line spacing.
| Page setup | Columns per line | Lines per page | Characters per page | Best for |
|---|---|---|---|---|
| A4 portrait | 73 | 49 | ≈ 3,580 | Notes, prose, most text files |
| A4 landscape | 110 | 32 | ≈ 3,520 | Wide logs, CSV dumps, code |
| Letter portrait | 75 | 45 | ≈ 3,380 | The same job on US paper |
| Letter landscape | 102 | 33 | ≈ 3,370 | Wide data on US paper |
| Legal portrait | 75 | 60 | ≈ 4,500 | Longest run of lines per page |
| Legal landscape | 135 | 33 | ≈ 4,460 | The widest line the tool will draw |
The pattern worth noticing: turning A4 sideways takes you from 73 columns to 110 without costing you much total capacity, because you trade width for height almost evenly. If a log is arriving mangled because its lines are 95 characters wide, landscape fixes it outright and costs nothing. That single switch solves more wrapping complaints than every other setting combined.
Font size is the other lever, and it moves both numbers at once.
| Font size (A4 portrait) | Columns per line | Lines per page | Characters per page |
|---|---|---|---|
| 8 pt | 100 | 67 | ≈ 6,700 |
| 9 pt | 89 | 59 | ≈ 5,250 |
| 10 pt | 80 | 53 | ≈ 4,240 |
| 11 pt (default) | 73 | 49 | ≈ 3,580 |
| 12 pt | 66 | 44 | ≈ 2,900 |
| 14 pt | 57 | 38 | ≈ 2,170 |
Dropping from 11 pt to 8 pt nearly doubles what a page holds, which is the difference between a 600-page printout and a 320-page one. Margins and line spacing help too, though less dramatically: pulling margins in from 20 mm to 10 mm buys you 8 more columns and 3 more lines, and tightening spacing from 1.35 × to 1 × takes A4 portrait from 49 lines to 66. The page recalculates all of this live, so the page count is on screen before you build anything.
Tabs, form feeds and line endings
These three are where most text-to-PDF conversions quietly go wrong — the reason a file that looked fine in an editor arrives looking broken.
A tab is a destination, not four spaces
A tab character does not mean "insert four spaces". It means "advance to the next column that is a multiple of the tab width". The distinction decides whether your columns line up.
Take the line ab[TAB]cd at a tab width of 4. Two characters are already used, so the tab is worth two spaces and the result is ab cd — with cd starting at column 4. Replace that tab with four spaces instead and you get ab cd, which starts at column 6. Every column after it on that line is now two places off.
The TXT to PDF converter advances to the stop. On abcd[TAB]ef it emits a full four spaces, because column 4 is already a stop and the next one is column 8. On a[TAB]b it emits three. Set the tab width to match whatever wrote your file — 4 is the common default, and a good deal of older tooling uses 8. If the indentation looks almost right but slightly off, that setting is nearly always the reason.
Form feeds still mean "new page"
The form feed character (number 12, often shown as ^L) is the plain-text way of saying "start a new page", and it is still sitting inside plenty of real files — compiler listings, generated reports, old documentation. Most converters treat it as an unknown character and either drop it or draw a box. This one takes the page break: feed it Page one.[FF]Page two. and you get a two-page PDF, paginated the way the author meant. If your file has none, you will never know the feature is there.
All three line endings count as one break
Text files end their lines one of three ways: LF on Unix and modern macOS, CRLF on Windows, and a bare CR on pre-2001 Macs. All three mean exactly one line break here, including a file that mixes them. This matters because the classic failure is a Windows file read with Unix assumptions — you get a stray control character at the end of every single line, or the whole file collapses onto one.
When you'll need to convert a text file to PDF
The most common reason is that somebody has to receive the thing. Logs and exports get attached to tickets, sent to auditors, or filed as evidence, and a .txt attachment is the one that opens differently on every machine it lands on. A PDF opens the same everywhere and keeps its pagination.
Printing is the second reason. Text files have no page size, so sending one to a printer is a guess — you find out how many sheets it wanted after the tray is empty. Converting first tells you it is 47 pages before you commit, and lets you fix it with a smaller font rather than a bigger recycling bin.
Then there is the archival case. Notes, transcripts, subtitle files and code listings all outlive the editor they were written in, and a paginated document with real embedded text stays searchable in a decade. Coursework and legal submissions often state the requirement outright: PDF, this paper size, these margins.
Edge cases and gotchas
Long lines wrap; they are never cut off. You choose how. Between words finds the last space that fits and breaks there, which reads well for prose. Anywhere breaks at the exact column, which is what fixed-width data wants. On a narrow 12-column page, "The quick brown fox jumps over the lazy dog." comes out as The quick / brown fox / jumps over / the lazy / dog. in word mode, and The quick br / own fox jump / s over the l / azy dog. in character mode. Same characters, different break points, nothing lost either way.
Some characters cannot be drawn. The font built into every PDF reader covers the Latin alphabet plus Western European accents, and nothing beyond it. café, naïve and señor come through intact. Chinese, Japanese, Korean, Cyrillic, Greek, Arabic, Hebrew and emoji do not, and each becomes a question mark — the Russian word Привет arrives as six of them. The TXT to PDF converter counts these before you build anything and names the exact characters it cannot draw, rather than letting you discover it after downloading. Common typographic characters are folded rather than lost: curly quotes become straight ones, en and em dashes become hyphens, an ellipsis becomes three dots, a bullet becomes an asterisk.
The limits are 5 MB of text and 2,000 pages, whichever you hit first. 5 MB of plain text is roughly 800,000 words, so this is a genuinely large document. Past either limit you get told which one you hit rather than watching the tab freeze. Settings are bounded too — font size 4 to 72 pt, margins 0 to 100 mm, line spacing 1 × to 4 ×, tab width 1 to 16 — and anything outside that range gets an explanation instead of a broken page.
One thing TXT to PDF deliberately will not do: proportional fonts. A .txt file's alignment is its only formatting, and a proportional face destroys every table, tree and indented block in it. If you want styled headings, you want a word processor, not a text converter.
Related PDF and text tools
Going the other way, Extract Text from PDF pulls the text back out — the round trip for anything you converted here. If your file is bigger than one pass allows, split it, convert the parts, and join them with the PDF Merger. PDF Page Count answers "how long is this actually" for PDFs you did not make, and Compress PDF helps when a file has to clear an attachment limit.
For documents that are not plain text, Word to PDF handles .docx and Excel to PDF handles spreadsheets. On the text side, the word counter tells you how much you are about to paginate, and the line break remover cleans up text that arrived with breaks in the wrong places.
Frequently asked questions
Does my file get uploaded anywhere?
No. Your browser reads the file, lays it out on your machine, and hands you the PDF. There is no server in the path. You can prove it two ways: open the network tab and watch nothing happen, or disconnect from the internet after the page loads and convert anyway. It still works. That matters more for text files than for most formats, because what people convert tends to be logs, exports and notes with real content in them.
Is the PDF real text, or a picture of text?
Real text. Open it and press Ctrl+F — or Cmd+F on a Mac — and you can search it, select it and copy out of it. This is worth checking on any converter, because a common shortcut is to draw the page onto a canvas and paste that image in. The result looks fine on screen and is useless for everything else: no search, no copy, nothing for a screen reader, and a file many times larger than it needs to be. Here, 3,000 words comes out at about 46 KB across six pages, because what is stored is your characters and not a photograph of them.
Does it work with .log, .csv, .json or .md files?
Yes. Anything made of plain text goes through the same path: .log, .md, .csv, .tsv, .json, .yml, .srt and .sql all work. For fixed-width data like a CSV or a log, switch the line breaking to Anywhere so columns break at the exact position rather than at a convenient space.
Why did my small log file turn into hundreds of pages?
Because a page holds roughly 3,580 characters at the defaults, so a 2 MB log is genuinely around 560 pages. Three things shrink it: landscape, which takes you from 73 columns to 110; a smaller font, where 8 pt nearly doubles what fits; and narrower margins. The count updates live, so you can find a combination you like before building anything.
Does it work on a phone, and does it work offline?
Both. Everything runs in the browser you already have, so a phone or tablet works the same as a laptop, with no app to install. Once the page has loaded, the conversion needs no connection at all.
What does it cost?
Nothing, and there is no account, no watermark, no daily cap and no "two conversions then upgrade" gate. A single-purpose converter does not need a subscription attached to it, and metered pricing on something your own machine does in a second has never made much sense. Microapp gives 10% of every dollar it earns to charity, off the top and audited quarterly.
My columns still look wrong. What should I check first?
Start with tab width, because it is the cause about four times out of five — set it to whatever wrote the file, usually 4 or 8, and watch the indentation snap into place. If lines are wrapping when they should not be, compare your longest line against the columns-per-line number on screen; if the line is longer, switch to landscape or drop the font size a point or two. And if the alignment is broken only in a few spots, check the character warning — a substituted character can shift a row, and the tool lists exactly which ones it could not draw.