Number Base Converter
Convert between decimal, binary, octal, and hexadecimal. Type in any field and the other three update instantly.
All processing is client-side — your data never leaves your browser.About number bases
Binary (base 2)
Every piece of data a computer processes is ultimately binary: a sequence of 1s and 0s. Each digit is called a bit. Eight bits form a byte, which can represent values from 0 to 255. Binary makes logical operations like AND, OR, and XOR trivially fast in hardware.
Hexadecimal (base 16)
Hex uses digits 0–9 and letters A–F. One hex digit represents exactly four binary bits, so two hex digits cover a full byte. You see hex everywhere: CSS colors (#4f46e5), memory addresses, SHA hashes, and UUID segments. It compresses long binary strings into readable shorthand.
Octal (base 8)
Octal groups binary into three bits per digit. It was popular on older hardware, and it still appears in Unix and Linux file permissions. The command chmod 755 sets permissions using octal: 7 = rwx, 5 = r-x, 5 = r-x for owner, group, and others respectively.
Signed integers
This tool converts non-negative integers. For signed values (negative numbers), computers use two's complement: flip all bits and add 1. A signed 8-bit integer can hold values from -128 to 127, while an unsigned 8-bit integer holds 0 to 255. The bit pattern is identical — only the interpretation differs.
How to use
- 1Enter a number
Type a number in any of the four fields — decimal, binary, octal, or hexadecimal.
- 2See all conversions
All other fields update instantly to show the equivalent value in every other base.
- 3Copy any result
Click any field and copy the value you need.
Frequently asked questions
What is a number base?
A number base (or radix) defines how many unique digits a number system uses. Decimal uses 10 digits (0–9), binary uses 2 (0–1), octal uses 8 (0–7), and hexadecimal uses 16 (0–9 and A–F). Computers internally work in binary; hexadecimal is a compact human-readable representation of binary data.
What is hexadecimal used for?
Hexadecimal (base 16) is used extensively in computing: CSS colors (#FF5733), memory addresses (0x7ffeedcba984), Unicode code points (U+1F600), network MAC addresses, and cryptographic hash outputs. Each hex digit represents exactly 4 binary bits, making the conversion between binary and hex very clean.
What is binary and why do computers use it?
Binary (base 2) uses only 0 and 1, which map directly to the two electrical states of transistors in a CPU: off (0) and on (1). All data stored and processed by a computer is ultimately binary — text, images, and programs are all sequences of bits.
What does the "0x" prefix mean?
0x is the conventional prefix used in most programming languages (C, Python, JavaScript, Go, etc.) to indicate that a number is written in hexadecimal. For example, 0xFF means 255 in decimal. The prefix has no numeric value — it is a notation convention.