Anyone who works with computer code or large datasets is probably familiar with a text editor. However, those who’ve worked mostly with a word processor like MS Word, Apple Pages, or Word Perfect might not know what a text editor is, or why it sometimes is the better tool.

Differences in a Nutshell

Word processors were designed to format text for presentation or production on a printed page. Word processor text contains hidden formatting information controlling margins, spacing, format (bold, italic,etc.) and other information needed for print output. The hidden coding makes word processor files significantly larger for a given amount of displayed text compared to plain text files. At one time nearly all word processors used proprietary file formats, but MS Word and others are moving towards a more standardized, XML-based file format.

Text editors are generally used for writing and editing code files for computer programs. Plain text files contain only visible characters, and usually are displayed using a monospace font. Plain text editors generate standardized file formats, with “.txt” as the default ending suffix. Other suffixes like “.html,” “.js,” and “.php” identify what programming or web-oriented language the file contains, and what programs can read the file successfully. Regardless of the suffix though, if the file is written in plain text, a plain text editor can open it, display the contents for editing, and save the file in correct format.

Why Do You Need a Text Editor?

A plain text editor is surprisingly useful. These are just a few examples to show why.

Text Cleanup. This is how many users get hooked on a text editor; they excel at stripping out extraneous hidden markup. Pasting text from a word processor or web page into a text editor removes all hidden data, leaving only the visible characters. Text that does not copy/paste correctly into a word processor file directly from the source usually can be cleaned up with a quick round trip through a text editor.

Text Extraction. Most text editors have tools for stripping raw HTML and Javascript markup out of source code copied from web pages. This can save hours of re-typing.

Faster on BIG Files. While a word processing file more than 2,000 lines (50-60 single-spaced pages) long becomes unwieldy, a 100,000-line still can be opened and handled quite easily.

Data Editing. Tabular data stored in a spreadsheet can be exported in a “.csv” or “.tsv” (comma-, tab-separated values) format that can be read by anyone with a plain text editor. , even if the file has some errors.

Search & Replace. Plain text is FAR easier to search and edit. Besides the traditional S/R found in word processors, most text editors also support GREP searching. There’s a learning curve initially, but GREP searches can find very complex strings with multiple wildcards.

There are only a handful of word processing programs in general use, but dozens of different plain text editors, and many people use more than one. Nearly all handle basic tasks well, so choosing a text editor depends more on which automated functions or advanced features are important, and how “comfortable” it feels to the user.

Wikipedia has an excellent list of plain text editors. Users can compare features and cost. If in doubt, start with simple and free, then move up as your primary needs become more apparent.