Skip to content

How to open a TXT file: which program to use on any device

The program that opens a text file on Windows, Mac, Linux, ChromeOS, iPhone and Android, how to read one in a browser, and how to fix text that shows strange characters.

By OpenAnyDoc · ·

The short answer

A .txt file is plain text, so any text editor opens it and you do not need to install anything. On Windows it opens in Notepad, on a Mac in TextEdit, on an iPhone or iPad in the Files app, and on Android in Google Docs, Google Drive or the text viewer of your file manager. Every web browser can show one too. If the text appears as strange symbols, the program has guessed the wrong encoding; the fix is further down.

Which program is used to open .txt files?

Every computer and phone comes with a program that opens .txt files, so you rarely need to install one. Double-click or tap the file and it opens in the program below; in any browser, the OpenAnyDoc TXT editor opens and edits it with nothing to install.

DeviceProgram that opens a .txt file
WindowsNotepad
MacTextEdit
LinuxThe desktop's text editor, such as GNOME Text Editor or KDE's KWrite
ChromeOSThe Files app: double-click the file
iPhone or iPadFiles
AndroidYour file manager, Google Docs or Google Drive
Any browserOpenAnyDoc TXT editor

On Windows

Double-click the file and it opens in Notepad, which comes with every version of Windows. If another program opens it instead, right-click the file, choose Open with, then Notepad, and choose to always use it if you want it as the default.

  • Notepad shows the text exactly as it is, with no formatting.
  • Microsoft Word also opens .txt files, and if the text looks garbled you can pick the encoding when you open the file, as Microsoft's page on choosing text encoding explains (checked 24 November 2026).
  • Free code editors such as Notepad++ or Visual Studio Code open text files too.

On a Mac

TextEdit opens plain text files. To read one without opening any app, select it in Finder and press the Space bar for a quick preview. If TextEdit shows the wrong characters, open TextEdit, Settings (Preferences on older versions of macOS), Open and Save, set the plain text encoding for opening files to the right one, for example Unicode (UTF-8), and open the file again. Apple describes these steps in its page on previewing files and its TextEdit guide (checked 24 November 2026).

On Linux

Every Linux desktop comes with a plain text editor. GNOME has Text Editor, described on its app page as a simple text editor, and KDE has KWrite, a text editor based on the editor component of Kate, according to KDE's app page (both checked 28 November 2026). Double-click the file in the file manager and it opens in the default application for its type.

To use another program on GNOME, right-click the file and pick the application from the top of the menu, or choose Open With… to see the others. To make that choice stick, right-click the file, select Properties, open the Open With tab, choose the application and click Set as default. GNOME's help page on opening files with other applications gives these steps (checked 28 November 2026). In KDE's file manager, Dolphin, right-clicking a file opens a menu of actions for it, as the Dolphin handbook says (checked 28 November 2026).

On ChromeOS

On a Chromebook, open the Files app, find the file and double-click it. Google's list of file types supported on a Chromebook includes .txt, and its page on opening files gives the double-click step (both checked 28 November 2026). To edit the text and save a copy in the encoding you choose, open the TXT editor in Chrome and pick the file there.

On a phone or tablet

On an iPhone or iPad, tap the file in the Files app to read the text; to change it, share it to an app that edits text, such as Pages. On Android, tap the file in your file manager or downloads: most phones show plain text directly, or offer Google Docs or Google Drive to open it. A phone browser works as well: in the TXT editor here the tools fold into a sheet and the text fills the screen.

In your browser, without installing anything

Every browser displays a text file: drag it onto an open window, or press Ctrl+O (Cmd+O on a Mac) and choose it. That shows the text, but you cannot change it.

To read and edit it, drop the file on the TXT editor. It opens with line numbers and search, and lets you type, find and replace, sort lines, remove duplicates and change case; Arabic lines show right to left. Download saves a copy in the encoding and line endings you choose. Your browser reads the file itself, so it is never uploaded, and the page keeps working offline once it has loaded.

When the text shows strange characters

A text file stores only bytes. The encoding says which bytes stand for which letters, and the file does not say which one it uses, so every program guesses. When the guess is wrong, Arabic turns into strings like "ال" or question marks, and accented letters break. Three encodings cover almost every file you will meet:

  • UTF-8 is the standard today and covers every language. Some programs put an invisible marker at the start of the file, the byte order mark or BOM, so that others recognise it.
  • UTF-16 is written by some Windows programs and exports. A program that expects UTF-8 shows it with gaps between the letters, or as nonsense.
  • Windows-1256 is the older Arabic encoding of Windows, still produced by some older systems. Programs that assume UTF-8 cannot read its Arabic letters.

Fix the encoding without uploading the file

Drop the file on the TXT editor. It recognises UTF-8 with or without a BOM, UTF-16, Windows-1256 and Windows-1252, and shows the encoding it found. If the text still looks wrong, choose another one in the Encoding group and click Reopen with this encoding.

To pass the file on safely, download it as UTF-8, which every modern program reads; choose UTF-8 with BOM if it will be opened in older Windows programs that otherwise guess the old code page.

Very large text files

Log files and data exports can run to hundreds of megabytes. Simple editors load the whole file at once and can become slow or stop responding with very large ones.

The TXT editor has been tested with a 46 MB file, whose first lines appear in under half a second. Files over 50 MB show a warning first, and a file of more than about 2 million characters opens in a fast read view that draws only the lines on screen, while search and the other tools still work on the whole text. Beyond that, the limit is your device's memory. If the file is really a table of values separated by commas, the large CSV viewer is the better fit.

What a .txt file is

A .txt file holds only characters: letters, digits, spaces and line breaks. There is no bold, no font, no pictures and no page layout, which is why every device can open it and why it is used for notes, logs, lists and passing data between programs. Each line ends with an invisible line break: Windows writes CRLF, while Mac and Linux write LF. Most editors read both, and the TXT editor can save either. Files with other extensions, such as .log or .md, are plain text too and open in any text editor in the same way.

Questions?

Write to support@openanydoc.com and describe what you see when you open the file (no personal data).