encoding
Number Base Converter
Convert numbers between binary, octal, decimal, and hexadecimal.
Number Base Converter
Convert numbers between binary, octal, decimal, and hexadecimal.
What is this?
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
- 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.
FAQ
- 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.
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.