How binary, decimal, hexadecimal, and octal relate
Number bases use different sets of digits to represent the same integer. Decimal is base 10, binary is base 2 and uses only 0 and 1, hexadecimal is base 16 and uses 0–9 plus A–F, and octal is base 8 and uses digits 0–7.
Worked example: 255
The decimal integer 255 is 11111111 in binary, FF in hexadecimal, and 377 in octal. Hexadecimal is compact because one hex digit represents four binary bits: F equals 1111, so FF represents eight one-bits.
Enter a non-negative whole number using only digits valid for the selected base. This converter accepts the digits themselves, not programming-language prefixes such as 0x or 0b, and it is limited to integers JavaScript can represent exactly. It does not convert fractional or negative values.
Tips for accurate results
Remember that each hexadecimal digit stands for exactly four binary digits, which is why programmers like it for compact notation. For example, decimal 255 is FF in hex and 11111111 in binary. Hex digits run from 0 to 9 and then A to F, and letters are normally case-insensitive.
Common mistakes and limits
This tool converts how a number is written, not what it means. Whether a binary pattern is a signed or unsigned integer, a character code, or a color depends on the context in your program. Watch for leading zeros and for prefixes such as 0x and 0b, which are part of the notation rather than the value.