Binary File Definition

A binary file is any file that contains at least some data that consists of sequences of bits that do not represent plain text.

A file is a named collection of related information that appears to the user as a single, contiguous block of data and that is retained in storage (e.g., a hard disk drive, optical disk or magnetic tape). Plain text consists of human-readable characters (as well as a few control characters which indicate the start of new lines, tabs, etc.) that is interpreted through a common character set (most often ASCII).

Binary refers to any system that uses two alternative states, components, conditions or conclusions. A bit (a contraction of the term binary digit) is the most basic unit of information in computing and communications, and every bit has a value of either zero or one.

Binary files are used for images, sound, executable (i.e., runnable) programs and compressed data (including documents created by most word processing programs). They are usually the most compact means of storing data, because of data compression, and programs stored in binary form can execute very quickly.

However, there are also some disadvantages to the use of binary files. In particular, many systems of binary encoding are proprietary (i.e., commercial and secret) and unique to particular hardware and software systems. Thus, there are frequently issues with regard to the portability (i.e., the ability to be used with other hardware and software) and long-term accessibility of data and programs that use such systems. Another is that they, or at least the binary part of them, are not human-readable, which can make it difficult to correct or modify them. If the application program that created a binary file is no longer available, which can occur with the passage of time, the file can become useless and its data lost forever.

An important tenet of the Unix philosophy is to avoid storing data and programs in binary files to the extent practical. Rather, they should be stored in plain text files because text is a universal interface among programs and humans. It is the use of text outputs and inputs that allows programs in Unix-like operating systems to work together so easily and efficiently (i.e., through the use of pipes). Although text files might not be as fast (or as small) as binary files, this is easily compensated for by high speeds of modern processors (and the low cost of memory and storage).

Created February 12, 2006.
Copyright © 2006 The Linux Information Project. All Rights Reserved.