Free Number Base Converter Online - Binary, Octal, Decimal & Hexadecimal
Type in any field — Binary, Octal, Decimal, or Hex — and all other bases update instantly. Adjust bit width for two's complement representation of negative numbers.
Binary (Base-2)
Digits: 0–1. The native language of computers.Octal (Base-8)
Digits: 0–7. Common in Unix file permissions.Decimal (Base-10)
Digits: 0–9. Standard human-readable format.Hexadecimal (Base-16)
Digits: 0–F. Used for memory addresses, color codes, and binary dumps.Show calculation steps
No conversion in progress.
Usage Examples
Click any card to load the value into the converter
Maximum unsigned 8-bit value
1 Kilobyte (2¹⁰ bytes)
The Answer to Life, the Universe, and Everything
Negative one — two's complement
0xDEADBEEF — the classic hex spell
Maximum unsigned 16-bit value
How to Use Number Base Converter
Type in Any Field
Enter a number in any of the four base fields — Binary, Octal, Decimal, or Hex. All other fields update instantly in real time.
Adjust Bit Width and Format
Choose a bit width (8, 16, 32, or 64) for two's complement representation. Toggle prefixes (0b, 0o, 0x) and binary grouping for readability.
Copy or Click Examples
Use the copy button on each card to grab a value. Click any example below to auto-fill all four fields at once.
Frequently Asked Questions
Number Base Basics
What are number bases?
A number base (or radix) is the number of unique digits used to represent numbers in a positional numeral system. Decimal (base-10) uses digits 0–9, binary (base-2) uses 0–1, octal (base-8) uses 0–7, and hexadecimal (base-16) uses 0–9 and A–F. Different bases are used in computing because binary represents machine-level data, octal and hex provide more compact representations of binary values, and decimal is human-friendly for everyday math. Understanding number base systems is fundamental for any developer working with low-level programming, memory addresses, or data encoding.
Why do developers need base conversion?
Developers need base conversion for many tasks: debugging memory addresses (hex), working with bit flags and masks (binary/hex), reading network protocols or file formats (hex dumps), color values in CSS (hex), and low-level programming where binary representation matters. Converting between bases helps developers understand how data is stored, manipulate individual bits with bitwise operators, and communicate between different systems or programming languages. This base conversion tool makes it trivial to switch between representations in real time.
When should I use binary vs hexadecimal?
Use binary when you need to see individual bit values — for bitwise operations, flags, or shifting. Binary shows exactly which bits are set, which is critical when debugging hardware registers or implementing bit-level protocols. Use hexadecimal when you need a compact, human-readable representation of binary data. Every hex digit represents exactly 4 bits, making it easy to convert mentally between binary and hex. Hexadecimal is commonly used for memory addresses, color codes, cryptographic keys, and debugging raw data where binary would be too long and decimal would obscure the byte boundaries.
Signed Numbers & Two's Complement
Does this tool support negative numbers? How are they converted?
Yes, this number base converter fully supports negative numbers using two's complement representation. When you type a negative decimal number (e.g., -42), the tool performs these steps: (1) Take the absolute value in binary (42₁₀ = 00101010₂ for 8-bit). (2) Invert all bits — flip every 0 to 1 and every 1 to 0 (00101010 → 11010101). (3) Add 1 to the result (11010101 + 1 = 11010110). The final value 11010110₂ = D6₁₆ is the two's complement representation of -42 in 8-bit. Select a different bit width from the dropdown and the tool automatically recalculates — at 16-bit, -42 becomes 1111111111010110₂ = FFD6₁₆. Open the "Show calculation steps" panel to see this breakdown for any negative value you enter.
What is two's complement and why does it matter?
Two's complement is the universal standard for representing signed integers in modern computers. The rule is simple: to negate a number, invert all bits and add 1. For a given bit width, the range of representable values is: 8-bit (−128 to 127), 16-bit (−32,768 to 32,767), 32-bit (−2,147,483,648 to 2,147,483,647), 64-bit (−9.22 × 10¹⁸ to 9.22 × 10¹⁸). The most significant bit (leftmost) acts as the sign bit: 0 = positive, 1 = negative. Two's complement has three key advantages: addition and subtraction work identically for positive and negative values (no special hardware needed), there is exactly one representation of zero (unlike one's complement which has +0 and −0), and overflow wraps around cleanly. This is why languages like C, Go, Rust, and Java all use it for their signed integer types (int8, int16, int32, int64).
How do I tell if a hex or binary value represents a negative number?
In two's complement, the most significant bit (MSB) determines the sign. For binary, look at the leftmost bit: 0 means positive (or zero), 1 means negative. For example, 01111111₂ = +127, but 11111111₂ = −1 (in 8-bit). For hexadecimal, check the leftmost digit: if it is 8–F, the value is negative when interpreted as two's complement. For instance, 7F₁₆ = +127, but FF₁₆ = −1 in 8-bit. The exact threshold depends on the bit width: at 8-bit, any hex value ≥ 80₁₆ is negative; at 16-bit, ≥ 8000₁₆; at 32-bit, ≥ 80000000₁₆; at 64-bit, ≥ 8000000000000000₁₆. This pattern is why memory dumps and debuggers frequently show negative numbers as high hex values like FFFFFFFF or FFFF.
Applications & Manual Conversion
Where is binary used in programming?
Binary is used everywhere at the hardware level, but programmers work with binary in bitwise operations (AND, OR, XOR, NOT), bitmasks for permissions or feature flags, data compression and encryption algorithms, network packet parsing, binary file formats (images, executables), and embedded systems programming. Understanding binary helps optimize code, reduce memory usage, and troubleshoot low-level issues. Even in high-level web development, binary concepts appear in character encodings, hashing algorithms, and binary protocols like WebSocket frames.
Why is 255 a special number?
255 is significant in computing because it is the maximum value that can be stored in a single unsigned 8-bit byte (2⁸ − 1 = 255). It appears in RGB color values (each channel 0–255), IP address octets (0–255), ASCII extended character codes, and many legacy systems. In binary, 255 is 11111111 — all 8 bits set to 1. In hexadecimal it is FF. Understanding why 255 matters helps programmers grasp byte boundaries, integer overflow, data packing, and why many protocols and file formats use this limit as a natural boundary.
How do I convert decimal to binary manually?
To convert decimal to binary manually, repeatedly divide the number by 2 and record the remainder (0 or 1) from bottom to top. For example, decimal 13: 13 ÷ 2 = 6 remainder 1, 6 ÷ 2 = 3 remainder 0, 3 ÷ 2 = 1 remainder 1, 1 ÷ 2 = 0 remainder 1 — reading remainders upward gives 1101. For octal and hexadecimal, divide by 8 or 16 instead. This base conversion tool automates the entire process: just type a value in any base and all four representations update in real time, including proper two's complement handling for negative numbers.