Nepedia
Back to Discover
Fluent Reader
💻

Binary file

technology Maturity 11-13 Next article →

Computers store all their information using tiny pieces called bits. These bits are binary digits that use a code of zeros and ones. Most computers group eight of these bits together into a single byte.

While all data is technically binary, we usually divide files into two main groups. Text files use bits to represent letters and words through a system called character encoding. Binary files are files that are not text files. They hold all kinds of different information that is not just written words.

How a binary file works depends on the program that opens it. A binary file is often a sequence of bytes that represent something specific. For example, a file might hold a sound or a bright color for an image. Some files include a header at the very beginning to help the computer. This header contains metadata, which is extra information about the file itself. A header might use a magic number to identify the file type. A GIF file uses a header with text like GIF87a to show it is an image. If a file has no header, it is called a flat binary file.

Programmers and computer scientists have developed many ways to handle these files. When people send binary files over the internet, they sometimes change them. Some systems like email cannot handle all types of binary data easily. To fix this, they use a way to turn binary into printable text. One common method is called Base64 encoding. This process makes the file about 30% larger during the transfer. However, the file can be turned back into its original binary form after it arrives.

There are many ways to look at the data inside these files. If you open a binary file in a regular text editor, it looks strange. The editor tries to turn every byte into a character, which creates unreadable symbols. People use a special tool called a hex editor to see the data clearly. A hex editor shows the bytes as numbers or different types of characters. This is helpful for finding hidden text or checking for mistakes in a file. Some people even use these tools to see if software is acting in a suspicious way.

Binary files are very important for making different computers work together. When two files are binary compatible, they have the exact same sequence of bits. This means a file made on a Windows computer can work on a Macintosh. This helps people avoid the hard job of converting files between different systems. However, some computers store bytes in a different order, which is called endianness. Without the right rules, binary data can be hard to understand. An algorithm must tell the computer how to read each bit or byte.

460 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

More to explore

🔬 Go deeper

More advanced topics to explore

🪜 Step back

Simpler topics to build understanding

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.