Number Base Converter

Decimal, binary, hex, octal — all at once. Edit any field and the rest update instantly.

(0–9)
(0, 1)
(0–9, A–F)
(0–7)

How the Number Base Converter Works

Type a number in any of the four fields — decimal (base 10), binary (base 2), hexadecimal (base 16), or octal (base 8) — and all other fields update instantly. The converter uses JavaScript's built-in parseInt() for parsing and number.toString() for conversion, so results are accurate up to Number.MAX_SAFE_INTEGER (2⁵³ − 1).

If you enter an invalid character for a base (for example, '2' in a binary field), an error message appears explaining what characters are allowed. Hexadecimal output is always shown in uppercase (A–F). Each field has a Copy button for quick clipboard access.

Number Bases Explained

  • Decimal (base 10): the everyday number system using digits 0–9. Each position represents a power of ten. The number 255 means 2×100 + 5×10 + 5×1.
  • Binary (base 2): uses only 0 and 1. The fundamental language of computers since all data is stored as sequences of bits (binary digits). 255 in binary is 11111111.
  • Hexadecimal (base 16): uses digits 0–9 and letters A–F. Widely used in programming, web colors (#FF5733), memory addresses, and debugging. Compact: one hex digit represents exactly 4 binary bits. 255 = FF.
  • Octal (base 8): uses digits 0–7. Historically used in computing and Unix file permissions (chmod 755 uses octal). Less common today but still appears in low-level programming. 255 in octal is 377.

Frequently Asked Questions

Why is hexadecimal used for web colors?
Web colors (like #FF5733) use hexadecimal because each color component — red, green, and blue — ranges from 0 to 255. In hexadecimal, 0–255 maps perfectly to 00–FF: exactly two hex digits. This makes hex codes compact and easy to read for developers. #RRGGBB uses 6 characters to encode 3 × 8 bits = 24-bit color.
What does chmod 755 mean in octal?
In Unix file permissions, chmod 755 uses three octal digits: 7 (owner: read + write + execute = 4+2+1), 5 (group: read + execute = 4+1), and 5 (others: read + execute = 4+1). Each digit is the sum of permission bits — read (4), write (2), execute (1) — expressed as a single octal digit.
What is the largest number this converter supports?
The converter supports integers up to Number.MAX_SAFE_INTEGER, which is 9,007,199,254,740,991 (2⁵³ − 1). Beyond this limit, JavaScript cannot represent integers exactly, which would produce incorrect conversions. For most practical use cases — memory addresses, color codes, permissions — this limit is more than sufficient.

You might also need

Complementary tools based on what you're doing

🔐
Password GeneratorGenerate secure passwords
📲
qr-code-generatorEncode data as QR code
🎲
random-number-generatorGenerate random numbers
🎨
Color PickerHEX color codes