Plain text converters
A plain text file (.txt) holds only characters and line breaks: no fonts, colours, images or layout. That makes it the most portable document format there is, readable by every editor, search tool and programming language.
Convert Plain text
- PDF → TXTConvert PDF to text
- TXT → PDFConvert TXT to PDF
- EPUB → TXTConvert EPUB to TXT
- TXT → EPUBConvert TXT to EPUB
What to know about Plain text
- The encoding decides how letters beyond A-Z are stored; UTF-8 covers every alphabet.
- Windows ends lines with CR LF, Mac and Linux with LF; current editors read both.
- There is no page layout, so page breaks are written as marker lines or form feed characters.
File extensions: .txt
Where you meet Plain text files
Plain text is how software stores things meant for both people and programs: README and LICENSE files, robots.txt on every website, requirements.txt in Python projects, log files, and exported chat histories. Notepad, TextEdit and phone note apps save it, and Project Gutenberg offers every book as "Plain Text UTF-8". Archivists value it because a text file from decades ago still opens today without special software.
Plain text compared with other formats
- TXT or Markdown
- A Markdown file is a text file with conventions: # for headings, * for emphasis, - for lists. It reads fine as plain text and becomes formatted in GitHub, Obsidian or a converter. Use .txt when the symbols would be taken literally or confuse a program that reads the file.
- TXT or PDF
- A PDF has fixed pages, fonts and layout, which suits printing and handing in. A text file has none of that, so it reflows in any editor and can be searched, diffed and processed by scripts. Keep notes and data in .txt, and make a PDF when someone asks for one.
- TXT or EPUB
- A long text such as a novel or a transcript is tiring to read as .txt on a phone: no chapters, no table of contents, and lines broken at a fixed width. An EPUB reflows and remembers the reading position, so convert when the text is meant to be read rather than processed.
Common problems with Plain text files
Letters such as é or ø show up as é or a question mark
The file was saved in one encoding and opened in another, usually UTF-8 versus Windows-1252. Nothing is lost yet: reopen the file with the right encoding (in VS Code, Reopen with Encoding; in Notepad++, the Encoding menu) and save it as UTF-8. Saving after the letters are already broken makes the damage permanent.
Strange characters  at the start of the file
Those are the three bytes of a UTF-8 byte order mark (BOM) read as Windows-1252. Some Windows programs write a BOM, and some scripts, CSV importers and web servers then treat it as part of the first word. Save the file as "UTF-8" rather than "UTF-8 with BOM" in your editor.
"bad interpreter" or "\r: command not found" on Linux
A shell script or config file saved on Windows has CR LF line endings, and Linux reads the CR as part of each line. Convert the file with dos2unix, or switch the line ending to LF in your editor; VS Code shows CRLF or LF in the status bar and changes it with one click.
Every line is broken at the same width
Older e-mails, Project Gutenberg books and some exports end each line after about 70 characters. Word processors and e-readers then keep those breaks and show ragged short lines. Joining lines inside paragraphs while keeping empty lines between them fixes it; the TXT to EPUB converter does this for books. Tool: Convert TXT to EPUB.
Questions about Plain text
How do I find out which encoding a text file uses?
Windows 11 Notepad and VS Code show it in the status bar, and Notepad++ shows it in the Encoding menu. On Linux, file -i name.txt prints a guess (file -I on macOS). A file with only English letters is the same in UTF-8 and most older encodings, so the question only matters once accented letters appear.
Can a .txt file be dangerous?
A real text file only holds characters, and an editor does not run anything in it. The risk is a file named something like invoice.txt.exe or invoice.txt.js, which Windows shows as invoice.txt when file extensions are hidden. Turn on File name extensions in the View menu of File Explorer to see the full name.
How do I turn a text file into a PDF?
Open it in any editor and print to a PDF printer, or use TXT to PDF on this site, which can keep columns lined up with a monospaced font and add line numbers. The PDF holds real text, so it stays searchable.