There are text files and there are image, video, and music files. Why are image, video, and music files considered binary files, and why are text files not?
-
7We just call them binary to distinguish them from human-readable files. The ascii/utf data in a text file is still stored in binary by the computer, but it's a lot easier for a human to interpret with a simple text editor than an mp3 or a jpg. – Andrew Apr 11 '16 at 17:38
-
1@AndrewPiliser thank you for that quick response. do you know about any resource where I can learn about this topic everything about binaries I don't have a Computer Science degree and I'm interested to learn thank you – Luis Javier Apr 11 '16 at 17:45
-
1The various ways of encoding information on disc are called [File Formats](https://en.wikipedia.org/wiki/File_format). You an bing/google, for example, for [MP3 File Format](https://www.google.com/search?q=mp3+file+format&oq=mp3+file+format&aqs=chrome.0.0l6.1509j0j8&sourceid=chrome&ie=UTF-8) – Erik Eidt Apr 11 '16 at 17:49
-
If you google a few file formats you should be able to find explanations of how they are translated between bits on a drive and whatever they are supposed to mean. Some simple ones like [ASCII](https://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters) or [PBM](https://en.wikipedia.org/wiki/Netpbm_format#PBM_example) might be best to start with. – Andrew Apr 11 '16 at 17:51
-
1Possible duplicate of [What are binaries?](http://programmers.stackexchange.com/questions/121224/what-are-binaries) – svidgen Apr 11 '16 at 18:46
4 Answers
Obviously every file is binary when it comes down to it, since every file is stored as bytes and bits. But colloquially, binary file just means any file which is not a text file. And text file means a file which consists of characters (in some character encoding or character set) and which you can open and edit in an ordinary text editor.

- 57,310
- 21
- 127
- 176
It's a matter of levels of indirection and degree of convention, as so many things in CS are. All files are stored as binary, but some (text files) are stored with a sufficiently simple binary format (a text encoding) that any of a very wide range of programs can display at least a basically correct and useful rendering of the contents that can be edited by straightforward keyboard usage. This includes not only actual unstructured plain text, but also more heavily structured formats such as Markdown, XML, JSON, and so on … as well as source code in nearly any programming language.
Contrast this with sophisticated formats like MPEG-4 or XLSB, which require a much more substantial decoder to make any sense out of the file, and can only be edited (in the general case) with a complex and specialized UI.

- 345
- 1
- 6
- 14
Text files are also binary files. They are just binary files with file formats which follow certain conventions, like certain bit-sequences representing certain characters. But even those conventions aren't uniform, because there are many different character encodings, and different standards for line endings.

- 23,166
- 6
- 61
- 67
Everything in computers are stored as 0 or 1 i.e. so called binary values. You can open any file and read it in binary format irrespective of the file extension.
But the special logic is needed to read the file if those 0's and 1's means different to for that file. e.g. 1000001 can refer to its binary equivalent or decimal equivalent of 65 or if you want to read as ASCII then it would mean A.
All the logic is how you want to read it. Similarly the JPEG files are also binary but you read its values differently using different encoders.
As Shakespeare said "Beauty lies in the eyes of beholder."

- 109
- 3