Converting files

How do I convert a Notepad .txt file to PDF?

Save the file as UTF-8 in Notepad, upload it to TXT to PDF, choose the typeface, text size, paper and margins, and download. For a quick copy where Notepad's own layout is fine, Windows' Print to PDF works too.

5 min read

A .txt file is the simplest document there is, and turning it into a PDF sounds like it should need no thought. Mostly it doesn't. But two things catch people out: letters like é, ñ or ü turning into odd symbols, and long lines running off the edge of the page.

Two ways to do it

Print to PDF from NotepadTXT to PDF
NeedsWindowsAny browser, any device
TypefaceNotepad's current fontMonospace, Sans serif or Serif
PaperYour printer settingsA4, Letter, Legal or A3, portrait or landscape
Line numbersNoOptional
Long linesNotepad's own layoutWrapped at spaces by default
Non-Latin scriptsDepends on your installed fontsBangla, Hindi, Arabic, Chinese and others built in

For a one-off copy of a short note, Print to PDF is fine: in Notepad, choose File, then Print, pick Microsoft Print to PDF as the printer and save. For anything you will send, archive or print properly, the converter gives you control over the layout.

First, check the encoding

This is the cause of almost every broken character.

A text file is just numbers, and the encoding says which number means which letter. Modern Notepad saves as UTF-8, which covers every language. Older files, and files from older software, are often saved in a regional encoding shown in Notepad as ANSI.

TXT to PDF reads files as UTF-8, and also recognises UTF-16 files that start with the standard marker Notepad writes. An ANSI file's accented letters are not valid UTF-8, so they come out as replacement symbols.

To check and fix it in Notepad:

  1. Look at the status bar at the bottom of the Notepad window. It shows the encoding, such as UTF-8 or ANSI.
  2. If it is not UTF-8, choose File, then Save as.
  3. Set Encoding to UTF-8 and save.

Then convert the saved file.

Converting, step by step

  1. Open TXT to PDF and choose the file. It accepts .txt, .log and .md files. A Markdown file is printed as its plain text, not formatted.
  2. Set the options under Layout, described below.
  3. Press Create PDF, then Download.

The Layout options:

  • Typeface: Monospace (the default), Sans serif or Serif.
  • Text size: 6 to 20 points; 10 is the default.
  • Wrap long lines: on by default. It breaks at spaces, and only splits a word that is wider than the whole line.
  • Show line numbers: off by default.
  • Page size: A4, Letter, Legal or A3, and Orientation: portrait or landscape.
  • Margins: Narrow (1 cm), Normal (2 cm) or Wide (3 cm).

There is no box to paste text into. Save the text as a file first, even if it is only a few lines.

Which settings for which file

The fileSuggested settings
Notes, a letter, a short essaySerif or Sans serif, 11–12 pt, Normal margins
A log fileMonospace, 8–9 pt, landscape, line numbers on
A code listingMonospace, 9–10 pt, line numbers on
A report laid out in columns with spacesMonospace, landscape, small enough that the widest line fits

Keep Wrap long lines on unless you have checked that every line fits the page. With it off, a line longer than the page runs on past the right margin and is cut off at the edge of the paper.

Tabs and columns

Tabs are expanded to stops every 8 characters, a setting you cannot change. If your file was lined up in an editor that shows tabs 4 characters wide, the columns can shift. Converting tabs to spaces in your editor before saving keeps them exactly where you put them.

Columns only line up in Monospace, where every character has the same width.

Other languages

Bangla, Hindi, Arabic, Thai, Greek, Cyrillic, Chinese, Japanese and Korean text is drawn with Noto fonts built into the converter, with the letters joined and shaped properly. Two things to know:

  • These scripts use proportional fonts, so column alignment in Monospace only holds for Latin characters.
  • Files that mix Latin text with one other script work best. A file that mixes several different non-Latin scripts may not render all of them.

What the converter does not add

It prints your text and nothing else: no title, no header or footer, no page numbers. If you need them, add them to the finished PDF with Add Page Numbers or Header & Footer.

A single file can run to 200 pages. A longer text needs splitting into parts; afterwards, Merge PDF joins the results.

On a Mac, with TextEdit

TextEdit saves rich text (.rtf) by default, which TXT to PDF does not accept. Choose Format, then Make Plain Text, and save as a .txt file. TextEdit's own File, Export as PDF is the Mac equivalent of Print to PDF: quick, with less control over the layout.

Common questions

Why do accented letters turn into symbols in my PDF?

The text file was saved in a regional encoding, shown as ANSI in Notepad, rather than UTF-8. Open it in Notepad, choose Save as, set Encoding to UTF-8, and convert again.

Can I add line numbers?

Yes. Turn on Show line numbers. They appear in a grey column on the left; a wrapped line keeps a single number.

Can I paste text instead of uploading a file?

No. Save the text as a .txt file first, then upload it.

Does it convert Markdown formatting?

No. A .md file is accepted, but it is printed as plain text, symbols and all.

Will Bangla or Arabic text work?

Yes. Bangla, Hindi, Arabic and other scripts are drawn with built-in Noto fonts and shaped correctly. Save the file as UTF-8 first.

Why is part of a long line missing?

Wrap long lines was turned off, so the line ran past the right margin and was cut off at the edge of the paper. Turn wrapping back on, or use landscape and a smaller text size.