Rayo PDF GORayo PDF GO
TXT F
File format

What is the TXT File format?

What is a TXT file? Learn how UTF-8 encoding works, why accented characters break, and when plain text beats PDF or Word.

4 min read6 sectionsUpdated 2026-10-16

In 30 seconds

  • A TXT file stores only characters: no bold, fonts, images, or tables.
  • Any device can open it, which is why it lasts for decades without becoming obsolete.
  • Accented letters and the ñ display correctly if the file uses UTF-8; if you see strange symbols, it is an encoding problem.
  • Extracting the text from a PDF to TXT is useful for copying, searching, or analyzing, but it loses the layout.

1What is a TXT file and what is it used for?

A TXT file, or plain text file, contains only a sequence of characters: letters, numbers, punctuation marks, spaces, and line breaks. It does not store bold, font sizes, colors, tables, or images, because there is nowhere inside the file to record that information. What you see is exactly what is there.

That simplicity is its greatest strength. Any program that can read text can open it: Windows Notepad, TextEdit on Mac, a code editor, an Android phone, or a server with no screen. That is why it is used for quick notes, lists, log files, configuration files, source code, and as a neutral format for moving text from one program to another without dragging styles along.

2How are letters stored inside a TXT file?

A computer only stores numbers, so each character is translated into a number using a table called an encoding. The oldest and best known is ASCII, published as a standard in 1963, which covers the letters of the English alphabet, digits, and some symbols, but does not include accented letters or the ñ.

For Spanish and other languages, extended encodings such as ISO-8859-1 or Windows-1252 were used for years, adding accented vowels and the ñ. The problem was that every system used a different one. Today the dominant standard is UTF-8, which can represent virtually any language, emoji included, and stays compatible with ASCII. When you save a new TXT file, choose UTF-8 whenever the program lets you.

3Why does my TXT file show strange symbols instead of accented letters?

It almost always happens because the file was saved with one encoding and is being opened with another. Text written in Windows-1252 and read as UTF-8 turns an "ó" into two odd characters, and the reverse is also true. Files do not carry a reliable label saying how they were saved, so the program has to guess.

The fix is to open the file while specifying the correct encoding, or to save it again as UTF-8. In Windows Notepad, the Save As option lets you choose the encoding; in editors such as VS Code or Notepad++ you can reopen the file with a different encoding until the letters look right. If the text comes from another system, trying Windows-1252 usually solves most cases in Spanish.

  • If you see "ó" where there should be an "ó", the file is UTF-8 and is being read as Windows-1252.
  • If you see a diamond with a question mark, the file is not UTF-8 and the program is reading it as if it were.
  • To share files safely, always save in UTF-8.

4TXT vs. PDF, Word, and Markdown: when should you use each?

A PDF freezes the look of a document: fonts, margins, images, and pagination appear the same on any device. A DOCX lets you edit with formatting and is the standard for collaborating on office documents. A TXT, on the other hand, gives up all layout in exchange for light weight, durability, and total compatibility.

Markdown sits in the middle: it is still plain text, but with simple marks (hash signs, asterisks) that can later be turned into headings and bold. If you only need to store or exchange words, TXT is enough. If you need someone to see your document exactly as you designed it, use PDF. If you need simple structure without losing the light weight, Markdown is a good option.

5Advantages and limits of plain text

Its advantages include a tiny size (an entire book fits in a few hundred kilobytes), the impossibility of containing macros or hidden code, how easy it is to search, compare, and track changes with version control tools, and the certainty that it will still be readable twenty years from now.

Its limits are obvious: it does not support images, real tables, active links, or visual emphasis. A table in a TXT file is just text lined up with spaces, which falls apart if you change the font. It is also not suitable as a final format for printing designed documents. In those cases, move the text into a styled format and export it as a PDF afterward.

6TXT and PDF: extracting the text and converting it back

When a PDF has a real text layer, you can extract its content to a TXT file to copy it, translate it, summarize it manually, index it, or paste it into another document. In Rayo PDF GO, the Extract text tool does exactly that on your device, without uploading the file. You will lose the layout, columns may get mixed up, and images are not included.

If the PDF is a scan, there is no text to extract: you first need optical character recognition, which Rayo PDF GO offers through its OCR tool. And in the opposite direction, a TXT file can be converted to PDF to share it with a uniform look using the Office to PDF tool, which is handy for meeting minutes, lists, or records you want to freeze.

One last tip: if you work with long texts, keep copies with clear names and dates, because a TXT file does not record who changed it or when. Since it is so light, it is easy to keep several versions and compare them later with any diff tool, something that is much heavier with more complex formats.

Related tools

Frequently asked questions

What is the difference between TXT and DOCX?

A TXT file stores only characters, while a DOCX also stores styles, tables, images, and page setup. That is why a TXT is much smaller and opens anywhere, but it keeps no layout at all.

How do I open a TXT file with accented letters without strange symbols?

Open it in an editor that lets you choose the encoding and try both UTF-8 and Windows-1252. Once the letters look right, save the file again as UTF-8 so it does not happen again.

Can a TXT file contain a virus?

Plain text itself is not executed, so it cannot infect your computer. What can happen is that a file with a misleading extension, such as document.txt.exe, hides a program, which is why it helps to keep file extensions visible.

Can a scanned PDF be converted to TXT?

Only if OCR is applied first, because a scan is an image with no real text. After OCR, you can extract the recognized text and save it as TXT, checking numbers and proper names.

What is the maximum size of a TXT file?

The format imposes no limit of its own; it depends on the program and the file system. In practice, common editors handle several megabytes well, and specialized editors open files of several gigabytes.