All Topics  
Binary file

 

   Email Print
   Bookmark   Link






 

Binary file



 
 
A binary file (.bin) is a computer file
Computer file

A computer file is a block of arbitrary information, or resource for storing information, which is available to a computer program and is usually based on some kind of durable computer storage....
 which may contain any type of data, encoded in binary
Binary numeral system

The binary numeral system, or notation with a radix of 2. Owing to its straightforward implementation in digital electronic circuitry using logic gates, the binary system is used internally by all modern computers....
 form for computer storage and processing purposes; for example, computer document files
Document file format

A document file format is a Text file or Binary file computer file format for storing documents on a computer storage, especially for use by computers....
 containing formatted text
Formatted text

Formatted text, styled text or rich text, as opposed to plain text, has styling information beyond the minimum of semantic elements: colours, styles , sizes and special features ....
. Many binary file format
File format

A file format is a particular way to encode information for storage in a computer file.Since a disk drive, or indeed any computer storage, can store only bits, the computer must have some way of converting information to 0s and 1s and vice-versa....
s contain parts that can be interpreted as text; binary files that contain only textual data - without, for example, any formatting information - are called plain text files
Text file

A text file is a kind of computer file that is structured as a sequence of line . A text file exists within a computer file system. The end of a text file is often denoted by placing one or more special characters, known as an end-of-file marker, after the last line in a text file....
. In many cases, plain text files are considered to be different from binary files because binary files are made up of more than just plain text. When downloading, a completely functional program without any installer is also often called program binary, or binaries (as opposed to the source code
Source code

In computer science, source code is any collection of statements or declarations written in some human-readable computer programming language....
).

Structure
Binary files are usually thought of as being a sequence of byte
Byte

A byte is a basic unit of measurement of Computer storage in computer science. In many computer architectures it is a Byte addressing memory address space....
s, which means the binary digits (bit
Bit

A bit is a binary numeral system numerical digit, taking a value of either 0 or 1. Binary digits are a basic unit of information Computer data storage and transmission in digital computing and digital information theory....
s) are grouped in eights.






Discussion
Ask a question about 'Binary file'
Start a new discussion about 'Binary file'
Answer questions from other users
Full Discussion Forum



Encyclopedia


A binary file (.bin) is a computer file
Computer file

A computer file is a block of arbitrary information, or resource for storing information, which is available to a computer program and is usually based on some kind of durable computer storage....
 which may contain any type of data, encoded in binary
Binary numeral system

The binary numeral system, or notation with a radix of 2. Owing to its straightforward implementation in digital electronic circuitry using logic gates, the binary system is used internally by all modern computers....
 form for computer storage and processing purposes; for example, computer document files
Document file format

A document file format is a Text file or Binary file computer file format for storing documents on a computer storage, especially for use by computers....
 containing formatted text
Formatted text

Formatted text, styled text or rich text, as opposed to plain text, has styling information beyond the minimum of semantic elements: colours, styles , sizes and special features ....
. Many binary file format
File format

A file format is a particular way to encode information for storage in a computer file.Since a disk drive, or indeed any computer storage, can store only bits, the computer must have some way of converting information to 0s and 1s and vice-versa....
s contain parts that can be interpreted as text; binary files that contain only textual data - without, for example, any formatting information - are called plain text files
Text file

A text file is a kind of computer file that is structured as a sequence of line . A text file exists within a computer file system. The end of a text file is often denoted by placing one or more special characters, known as an end-of-file marker, after the last line in a text file....
. In many cases, plain text files are considered to be different from binary files because binary files are made up of more than just plain text. When downloading, a completely functional program without any installer is also often called program binary, or binaries (as opposed to the source code
Source code

In computer science, source code is any collection of statements or declarations written in some human-readable computer programming language....
).

Structure


Binary files are usually thought of as being a sequence of byte
Byte

A byte is a basic unit of measurement of Computer storage in computer science. In many computer architectures it is a Byte addressing memory address space....
s, which means the binary digits (bit
Bit

A bit is a binary numeral system numerical digit, taking a value of either 0 or 1. Binary digits are a basic unit of information Computer data storage and transmission in digital computing and digital information theory....
s) are grouped in eights. Binary files typically contain bytes that are intended to be interpreted as something other than text character
Character (computing)

In computer and machine-based telecommunications terminology, a character is a unit of information that roughly corresponds to a grapheme, grapheme-like unit, or symbol, such as in an alphabet or syllabary in the written language form of a natural language....
s. Compiled computer programs are typical examples; indeed, compiled applications (object file
Object file

In computer science, object code, or an object file, is the representation of code that a compiler or assembler generates by processing a source code file....
s) are sometimes referred to, particularly by programmers, as binaries. But binary files can also contain images, sounds, compressed versions of other files, etc. — in short, any type of file content whatsoever.

Some binary files contain headers
Header (information technology)

In information technology, header refers to supplemental data placed at the beginning of a block of data being stored or transmitted. In data transmission, the data following the header are sometimes called the Payload or body....
, blocks of metadata
Metadata

Metadata is "data about other data", of any sort in any media. An item of metadata may describe an individual datum, or content item, or a collection of data including multiple content items and hierarchical levels, for example a database schema....
 used by a computer program
Computer program

Computer programs are Instruction for a computer. A computer requires programs to function. Moreover, a computer program does not run unless its instructions are executed by a Central processing unit; however, a program may communicate an Algorithm#Formalization of algorithms to people without running....
 to interpret the data in the file. For example, a GIF
GIF

The Graphics Interchange Format is a Raster graphics that was introduced by CompuServe in 1987 and has since come into widespread usage on the World Wide Web due to its wide support and portability....
 file can contain multiple images, and headers are used to identify and describe each block of image data. If a binary file does not contain any headers, it may be called a flat binary file.

Manipulation


To send binary files through certain systems (such as e-mail
E-mail

Electronic mail, often abbreviated as e-mail, email, E-Mail, or eMail, is any method of creating, transmitting, or storing primarily text-based human communications with digital communications systems....
) that do not allow all data values, they are often translated into a plain text representation (using, for example, Base64
Base64

The term Base64 refers to a specific MIME#Content-Transfer-Encoding. It is also used as a generic term for any similar encoding scheme that encodes binary data by treating it numerically and translating it into a base 64 representation....
). This encoding has the disadvantage of increasing the file's size by approximately 30% during the transfer, as well as requiring translation back into binary after receipt. See Binary-to-text encoding for more on this subject.

Microsoft Windows
Microsoft Windows

Microsoft Windows is a series of software operating systems and graphical user interfaces produced by Microsoft. Microsoft first introduced an operating environment named Windows in November 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces ....
 allows the programmer to specify a system call
System call

In computing, a system call is the mechanism used by an application program to request service from the kernel based on the Monolithic_kernel or to system servers on operating systems based on the microkernel-structure....
 parameter indicating if a file is text or binary; Unix
Unix

Unix is a computer operating system originally developed in 1969 by a group of American Telephone & Telegraph employees at Bell Labs, including Ken Thompson , Dennis Ritchie, Douglas McIlroy, and Joe Ossanna....
 does not, and treats all files as binary. This reflects the fact that the distinction between the two types of files is to a certain extent arbitrary
Arbitrary

Arbitrariness is a term given to choices and actions which are considered to be done not by means of any underlying principle or logic, but by whim or some decidedly illogical formula....
.

Viewing


A hex editor
Hex editor

A hex editor is a type of computer program that allows a user to manipulate Binary file computer files. Hex editors that were designed to edit Disk sector, or parse, data from floppy disk or hard disks were sometimes called sector editors or disk editors....
 or viewer may be used to view file data as a sequence of hexadecimal (or decimal, binary or ASCII character) values for corresponding bytes of a binary file.

If a binary file is opened in a text editor
Text editor

A text editor is a type of software application used for editing plain text files.Text editors are often provided with operating systems or software development packages, and can be used to change configuration files and programming language source code....
, each group of eight bits will typically be translated as a single character, and you will see a (probably unintelligible) display of textual characters. If the file were opened in some other application, that application will have its own use for each byte: maybe the application will treat each byte as a number and output a stream of numbers between 0 and 255 — or maybe interpret the numbers in the bytes as colors and display the corresponding picture. If the file is itself treated as an executable
Executable

In computing, an executable causes a computer "to perform indicated tasks according to encoded instruction ," as opposed to a file that only contains data ....
 and run, then the operating system will attempt to interpret the file as a series of instructions in its machine language.

Interpretation


Standards are very important to binary files. For example, a binary file interpreted by the ASCII character set will result in text being displayed. A custom application can interpret the file differently, a byte may be a sound, or a pixel, or even an entire word. Binary itself is meaningless, until such time as an executed algorithm defines what should be done with each bit, byte, word or block. Thus, just examining the binary and attempting to match it against known formats can lead to the wrong conclusion as to what it actually represents. This fact can be used in data hiding processes, where an algorithm interprets a binary data file differently to reveal hidden content. Without the algorithm, it is impossible to tell that hidden content exists.

See also


  • Executable
    Executable

    In computing, an executable causes a computer "to perform indicated tasks according to encoded instruction ," as opposed to a file that only contains data ....