Binary, Hex, Decimal — What They Actually Mean and When You Need Each One
Decimal is for humans, binary is for computers, hexadecimal is the bridge between them. Here's what each number base actually means and how to convert between them instantly.
You see 0xFF in CSS, 0b1010 in a microcontroller data sheet, and a Unix timestamp like 1719000000 in an API response. These are all the same thing — numbers — just written in different bases. A base converter translates between them instantly so you do not have to do the math by hand.
Why we use different number bases in the first place
Decimal (base-10) is what humans use. Ten digits: 0 through 9. It is natural for us because we have ten fingers. But computers do not have fingers — they have transistors that are either on or off, and that is where binary comes from.
Binary (base-2) is what computers actually use. Two digits: 0 and 1. Every piece of data in your computer — text, images, video, code — is ultimately stored as long strings of 0s and 1s. 01001000 01101001 is "Hi" in ASCII binary. Binary is perfect for machines and terrible for humans — a single byte takes 8 digits to write.
Hexadecimal (base-16) is the shorthand that makes binary readable. Sixteen digits: 0-9 plus A-F (where A=10, B=11, through F=15). Two hex digits represent exactly one byte, making it far more compact than binary. 0xFF is 255 in decimal and 11111111 in binary — hex is clearly the most human-readable of the three formats.
Where you actually encounter these in real work
Colors in CSS. #FF5733 is a hex color. FF is the red channel (255 in decimal), 57 is green (87), 33 is blue (51). Our color converter translates hex colors to RGB, HSL, and other formats — same number, different representation.
Memory addresses in debugging. When a program crashes, the error message shows memory addresses in hex: 0x7fff5c6b3a00. That is much shorter than writing 140734799998464 in decimal. Every developer eventually learns to read hex addresses.
MAC addresses on your network. Your device's hardware identifier looks like 00:1A:2B:3C:4D:5E — six pairs of hex digits. Each pair is one byte, and together they uniquely identify your network interface worldwide.
Unix timestamps in APIs. A Unix timestamp converter translates decimal epoch seconds into human-readable dates. 1719000000 becomes "June 21, 2024." Same number, different representation — exactly the kind of conversion base systems are about.
Octal — the one nobody talks about but you have seen
Octal (base-8) uses digits 0-7. It shows up most commonly in Linux file permissions: chmod 755 script.sh means the owner can read/write/execute (7 = 111 in binary = all permissions), while group and others can read/execute (5 = 101). Each octal digit maps to exactly three binary bits, which is why it was popular in early computing when 3-bit groups were common.
Try the free online base converter — type any number and see it in binary, octal, decimal, and hex simultaneously. It is the fastest way to check your work when reading hardware documentation or debugging low-level code. For a broader look at developer tools, see our curated list of essential online developer tools.
Tools mentioned in this article
Number Base Converter
Convert numbers between binary, octal, decimal, and hexadecimal. See all four bases at once when you type a number in any format. Includes hex color reference.
Unix Timestamp Converter
Convert Unix timestamps to human-readable dates and vice versa. Supports seconds and milliseconds. Shows UTC and local time side by side. Pick a date to get its timestamp.
Color Converter
Convert colors between HEX, RGB, HSL, and HSV formats. Adjust with sliders and see a live color preview. Copy CSS-ready values. Pick from a color wheel or paste any valid color.
