Number Base Converter
Convert between Binary (base 2), Octal (base 8), Decimal (base 10), and Hexadecimal (base 16). Edit any field and the rest update instantly.
Understanding Number Bases — Binary, Octal, Decimal, and Hexadecimal Explained
Number bases (also called radixes) are different ways to represent the same numerical value using different sets of digits. Understanding base conversion is fundamental to computer science, networking, and low-level programming.
The Four Most Common Number Bases in Computing
- Binary (Base-2) — Uses digits 0 and 1. The foundation of all digital computing — every piece of data in a computer is ultimately stored as binary. Used in bitwise operations, network subnet masks, and hardware design.
- Octal (Base-8) — Uses digits 0—7. Historically used in early computing. Still used today for Unix file permissions (
chmod 755), where each digit represents 3 binary bits (read/write/execute). - Decimal (Base-10) — Uses digits 0—9. The human-standard number system used in everyday life, mathematics, and most programming variables.
- Hexadecimal (Base-16) — Uses digits 0—9 and A—F. Each hex digit represents exactly 4 binary bits, making it a compact way to represent binary data. Used in CSS colors (
#FF5733), memory addresses, MAC addresses, IPv6 addresses, and byte values.
Quick Reference Table
- 255 decimal =
11111111binary =377octal =FFhex (max value of one byte) - 42 decimal =
101010binary =52octal =2Ahex (the answer to everything) - 256 decimal = 100000000 binary = 400 octal = 100 hex (one more than the maximum unsigned 8-bit value)
- 65535 decimal = 1111111111111111 binary = 177777 octal = FFFF hex (maximum unsigned 16-bit value)
Where You'll Use Base Conversion
- Reading hexdump output — Debug binary files, network packets, and memory dumps
- CSS and web development — Convert between hex color codes and RGB decimal values
- Network engineering — Calculate subnet masks, convert IPv6 addresses, read MAC addresses
- Unix/Linux administration — Set file permissions using octal notation (
chmod 644) - Bitwise operations — Understand flags, masks, and bit manipulation in binary
- Assembly and embedded programming — Memory addresses and register values in hexadecimal
Frequently Asked Questions
Enter a number in any field (binary, octal, decimal, or hexadecimal) and the tool instantly converts it to all other bases using JavaScript's built-in parseInt() and toString() functions. All conversions happen in your browser.
Binary (base-2) uses digits 0-1 and is the native language of computers. Octal (base-8) uses digits 0-7 and is used in Unix file permissions. Decimal (base-10) uses digits 0-9 and is the standard human number system. Hexadecimal (base-16) uses 0-9 and A-F and is widely used for colors, memory addresses, and byte representation.
Developers convert between bases for tasks like reading memory addresses (hex), setting Unix file permissions (octal), debugging bitwise operations (binary), working with CSS/HTML colors (#FF5733 is hex), analyzing network packets, and understanding low-level data representation in computing.
The implementation uses JavaScript Number and parseInt. Exact integer representation is guaranteed only through 9,007,199,254,740,991; larger inputs can lose precision. Negative inputs are ignored, fractions are not supported, and parseInt can accept a valid numeric prefix while ignoring trailing characters.
Number conversion runs locally. Optional browser drafts and normal website requests are separate from the calculation; local computation is not a confidentiality guarantee.