Convert between binary, octal, decimal, and hexadecimal instantly. Type in any field and all others update live.
| Dec | Bin | Oct | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 8 | 1000 | 10 | 8 |
| 16 | 10000 | 20 | 10 |
| 64 | 1000000 | 100 | 40 |
| 128 | 10000000 | 200 | 80 |
| 255 | 11111111 | 377 | FF |
| 65536 | 10000000000000000 | 200000 | 10000 |
Add this Number Base Converter to your website or blog for free — just paste this code:
Computers use binary because transistors — the fundamental building blocks — have two states: on (1) and off (0). This maps perfectly to binary. Everything a computer does, from adding numbers to displaying images, ultimately reduces to manipulating sequences of 0s and 1s.
Hex is used because one hex digit represents exactly 4 binary bits (a nibble), so two hex digits = one byte. This makes it far more human-readable than binary while still mapping cleanly to how computers work internally. It's widely used for memory addresses, colours (#FF6600), and byte-level data.
Each binary digit represents a power of 2, starting from the right. For 1011: (1×8) + (0×4) + (1×2) + (1×1) = 11. The tool does this instantly for any number.
Octal was historically used in older computing systems. Today it's most commonly seen in Unix/Linux file permissions (e.g., chmod 755 means rwxr-xr-x). Each octal digit represents exactly 3 binary bits.
JavaScript uses 64-bit floating-point numbers (IEEE 754), which means integers are exact up to 2^53 − 1 (about 9 quadrillion). Beyond that, precision may be lost. For very large numbers, use a dedicated big-integer library.
The Number Base Converter instantly converts numbers between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Type a value into any of the four fields and all the other fields update automatically in real time. There is no button to press — the conversion is live as you type. This makes it easy to explore how the same number is represented across different numeral systems, double-check conversions when working on programming problems, or quickly translate between formats without stepping through the arithmetic manually.
Computers fundamentally operate in binary — every piece of data is ultimately stored as zeros and ones. Decimal is the base-10 system humans use every day, with digits 0–9. Octal (base 8) was historically common in early computing and still appears in Unix file permissions. Hexadecimal (base 16) uses digits 0–9 and letters A–F to represent values 0–15, and is ubiquitous in programming: HTML colour codes, memory addresses, byte values, and debugging output are almost universally expressed in hex because two hex digits exactly represent one byte (8 bits), making it far more compact than binary while still mapping directly onto computer memory.
Understanding these number bases is fundamental for computer science students, software developers, embedded systems engineers, and network administrators. Binary is used in bitwise operations, boolean logic, and CPU instruction sets. Hex appears in CSS colours (e.g., #1A2B3C), IPv6 addresses, Unicode code points, and assembly language. Octal permissions in Linux/Unix (e.g., chmod 755) use base 8 because the three octal digits map neatly onto the three permission groups (owner, group, others) with read/write/execute values of 4, 2, and 1. The converter handles all these scenarios without requiring any manual calculation.
chmod 755 means in binary (rwxr-xr-x) and why those octal values correspond to those permissions.Hexadecimal is used because it maps cleanly onto binary. One hex digit represents exactly four bits (a nibble), so two hex digits represent exactly one byte (8 bits). This makes hex far more compact than binary for expressing memory addresses, byte values, and colour codes, while still having a direct, mechanical relationship to the underlying binary representation that decimal does not.
With n digits: binary can represent 2ⁿ values (0 to 2ⁿ−1), octal can represent 8ⁿ values, decimal can represent 10ⁿ values, and hexadecimal can represent 16ⁿ values. With 2 digits: binary = 0–3, hex = 0–255. This is why hex is so efficient — two characters cover the full range of a single byte.
Unix permissions are represented as three groups of three bits (read=4, write=2, execute=1). Each group's bits sum to a single octal digit. So permissions 111 101 101 in binary = 7 5 5 in octal = chmod 755 = owner can read/write/execute, group and others can read and execute only.
The converter works with non-negative integers. Negative numbers in binary are typically represented using two's complement in computer systems, which requires knowing the word size (8-bit, 16-bit, etc.) — this is handled by the processor or programming language, not by a simple base converter.
Hex uses digits 0–9 for values zero through nine, and letters A–F (or a–f) for values ten through fifteen. A = 10, B = 11, C = 12, D = 13, E = 14, F = 15. Hex is case-insensitive, so 1a2b and 1A2B represent the same value.