📄Binary File
Also known as Binary Format, Non-Text File
A file of raw bytes, not words. Pictures, apps and songs are all binary.
Think of it like
Think of it like a CD. A player can read it, but you cannot read it just by looking.
Example
Lucy opens song.mp3 in a text editor by mistake. She sees odd symbols, because the file is sound, not words.
Why it matters
Tools treat text and binary files in different ways. Git cannot show which lines changed in a picture.
Definition
Example code
console
$ head -c 8 photo.png | xxd
00000000: 8950 4e47 0d0a 1a0a .PNG....Common mistake
Key takeaways
- 1Raw bytes. Most bytes are not letters.
- 2Needs its program. Only a program for its format can read it.
- 3Compact. Often smaller than the same data as text.