## binary numbers are hard to read 1101010111011001 1101010111001001 it's hard to tell if these are different! Also, binary numbers are too long: the number 4,000,000,000 is this in binary: 11101110011010110010100000000000 ## decimal has problems too 11010101 = 213 11000101 = 197 These are easier to read, but 213 and 197 look COMPLETELY different, even though the binary numbers only differ by 1 bit. This is bad if you're trying to think about the binary representation. ## hexadecimal makes binary data more readable Every hexadecimal digit represents 4 bits. So 1 byte (8 bits) is 2 digits. 1101 0101 1100 0101 d 5 c 5 * 11010101 = d5 * 11000101 = c5 it's much easier to see the similarities! ## there are 16 hex digits * decimal binary hex * 0000 0 0 * 0001 1 1 * 0010 2 2 * 0011 3 3 * 0100 4 4 * 0101 5 5 * 0110 6 6 * 0111 7 7 * 1000 8 8 * 1001 9 9 * 1010 10 a * 1011 11 b * 1100 12 c * 1101 13 d * 1110 14 e * 1111 15 f ## `0x` means it's hex person 1: "the ASCII code for space is 0x20" person 2: "that starts with `0x`, so it means 32 and not 20!" ## things hexadecimal is used for * color codes! (eg 0xFF00FF) * memory addresses! * displaying binary data! (like with `hexdump`) )
https://cdn.masto.host/socialjvnsca/media_attachments/files/109/762/229/987/688/624/original/52f3d67844ab4d67.png