encoding
Number Base Converter
Convert numbers between binary, octal, decimal, and hexadecimal.
What is Number Base Converter?
The Number Base Converter converts integers between the four bases used in computing: binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Enter a number in any base and the tool returns all four representations instantly — no manual arithmetic required. It also returns a grouped binary format (4-digit nibbles) and grouped hex (2-digit bytes) for easier reading, the bit length of the value, and whether it is a power of two.
How to use Number Base Converter
- Enter your number: Type the value in the Input field. For hexadecimal, use digits 0–9 and letters A–F (case-insensitive). The 0x prefix is optional.
- Select the input base: Choose the base your number is in: Binary (base 2), Octal (base 8), Decimal (base 10), or Hexadecimal (base 16).
- Read all four outputs: The result shows the value in all four bases simultaneously — decimal, binary, octal, and hexadecimal — along with grouped formats and bit length.
Frequently asked questions
- What is binary (base 2)?
- Binary is the native number system of computers. Every integer is represented using only the digits 0 and 1. Each digit position represents a power of 2: the rightmost is 2^0 (1), then 2^1 (2), 2^2 (4), 2^3 (8), and so on. The decimal number 10 is 1010 in binary (8 + 2).
- What is hexadecimal (base 16) and why do developers use it?
- Hexadecimal uses 16 digits: 0–9 and A–F. Developers prefer hex because it maps cleanly to binary: each hex digit represents exactly 4 binary digits (a nibble). This makes hex a compact way to express binary values — the 8-bit byte 11111111 is simply FF in hex, and 32-bit memory addresses fit in 8 hex characters. CSS color values (#FF6600), file magic bytes, and network masks are all commonly expressed in hex.
- What is octal (base 8) used for?
- Octal uses digits 0–7. It is most commonly encountered in Unix file permission modes: chmod 755 means owner can read/write/execute (7 = 111 in binary), group can read/execute (5 = 101), others can read/execute (5 = 101). Octal also appears in older C codebases and network protocols. Each octal digit represents exactly 3 binary digits.
- Does this tool handle large numbers?
- Yes. The converter uses JavaScript's BigInt internally, so it handles arbitrarily large integers without precision loss — unlike Number, which loses precision above 2^53. You can convert a 256-bit integer accurately.
- How do I convert a hex color code to decimal RGB values?
- A CSS hex color like #FF6600 has three 2-digit hex components: R=FF, G=66, B=00. Convert each pair to decimal: FF → 255, 66 → 102, 00 → 0. The result is rgb(255, 102, 0). Use this tool for each pair, or use the Color Converter tool which handles full CSS color conversions.
- How do I read a Unix file permission number like chmod 755?
- Unix file permissions are specified in octal. 755 in octal breaks into three digits: owner (7), group (5), others (5). Each digit is a 3-bit mask: 4=read, 2=write, 1=execute. So 7 = 4+2+1 = rwx, and 5 = 4+1 = r-x. Enter 755 with 'from base' set to Octal to see the binary representation: 111 101 101 — confirming all three bit patterns.
- What does 'bit length' mean in the output?
- Bit length is the minimum number of binary digits needed to represent the value — the position of the most significant 1 bit. For example, 255 needs 8 bits (11111111). This is useful when choosing integer types: a value with bit length ≤8 fits in a uint8, ≤16 in a uint16, ≤32 in a uint32. Powers of two always have bit length equal to their exponent plus one.