A .txt file is one that contains plain text without any special formatting, fonts or images. Most computer operating systems include multiple tools that can be used to generate such a file. On an Apple Macintosh computer, you can create a text file with TextEdit for Mac, which ships with the operating system.
Text File on a Mac
A text file is one of the simplest types of files you can create on a computer. It can be opened by many different programs and doesn't include any special formatting, fonts, images or other embedded data. You can create one with almost any desktop, laptop or smart phone operating system on the market.
Still, there are differences between text files. Files can have different character encodings, which refers to how letters and other symbols such as emoji are translated into the numerical systems used by computers to store data. Common encodings in the United States include ASCII and Unicode, but there are other encodings used in other places for different languages.
Most Mac text file processing programs and other tools can automatically detect the encoding of a file, but if the wrong encoding is used, a file may be fully or partially illegible.
Different operating systems sometimes use different ways to represent the ending of a line of text. Many modern programs can handle multiple alternatives, but files can sometimes be mangled when sending them back and forth between operating systems such as Microsoft Windows, Apple macOS and Linux.
TextEdit is an application on every Mac that you can use to create and edit text files. It's included with all versions of macOS and OS X.
Find TextEdit in the Applications folder on your Mac computer. By default, it creates formatted documents saved in rich text format, but you can use it to create a plain text file on a Mac. To do so, launch the program, click the "Format" menu and select "Make Plain Text."
Use the "Open" command in the "File" menu to find, open and edit existing text documents.
Other Text Editors
Modern versions of macOS include at least two command line text editors: Emacs and Vim. These free and open source tools are typically used by programmers and system administrators. They can take some getting used to for new users.
It's possible to buy additional text editing software or find free text editing tools for a Mac or other computer. Sublime Text and Atom are common tools used for this purpose.
Word processing programs such as Microsoft Word can also edit and save text files.