Binary files, text files

From Helpful
Revision as of 19:08, 14 July 2022 by Helpful (talk | contribs)
Jump to navigation Jump to search

What do these terms even mean?

A "binary file" is, arguably, a file were there is useful data that is not text - and where that's probably most of the contents.

Binary data / binary file, usually means raw data that can take any values, and often also helps point out that it is not trivially human-readable, or human-editable. All e.g. unlike (plain) text.

(Note that there is no direct relation to binary in the on-off, base-two sense. Byte data may be a little clearer (or not) in that it avoids that association)



A text file is, arguably, a file where there the only useful data is text.

There is arguably no such thing as plain text. That is, there are too many variations, that are indistinguisable except for guessing hard.



If a file or (byte)string contains only text (particularly if in a common coding like ASCII, ISO8859, UTF8) it would often be called plain text.


A bytestring (sometimes binary string) is a sequence of bytes that can contain any value, not just readable characters.

Around C/C++ and some others, this also implies mean that the length is stored separately, because C's historic strings are null-terminated, which does not allow you to have strings containing the value 0x00 (NUL) without doing that.


A string in the wide sense refers to a string/array of values but (since we have words like array and list) it usually refers specifically to a string of readable characters (unless terms like bytestring are used).


A binary usually refers to a program in executable (and often compiled) form.

Seems to usually be considered a short for 'a binary executable'.