Two's Complement
Two's complement is the standard way to represent signed integers in binary. The most significant bit (MSB) acts as the sign bit: 0 for positive, 1 for negative. To get the negative value, invert all bits and add 1. For example, in 8-bit mode, -1 is represented as 11111111 (0xFF).
Number Base Converter is a free online tool for converting numbers between binary, octal, decimal, and hexadecimal. Supports 8/16/32/64-bit two's complement and a visual bit editor. Runs entirely in your browser.
What is Number Base Conversion?
This tool converts numbers between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16) in real time. It also supports 8/16/32/64-bit two's complement representation with a visual bit editor for toggling individual bits.
Common Use Cases
Systems Programming
Debug low-level protocols, network packets, or binary file formats that use hexadecimal or octal notation.
Hardware & Color
Convert color values between hex and decimal, or calculate memory addresses and offsets during embedded development.
How to Convert Number Bases
- 1
Enter a value
Type a number in any base — decimal, hexadecimal (0x prefix), octal (0o prefix), or binary (0b prefix). All other bases update instantly.
- 2
Choose bit width
Select 8, 16, 32, or 64-bit mode to see the two's complement representation and toggle individual bits in the visual editor.
- 3
Copy the result
Click the copy button next to any base conversion to copy the formatted value.
| DEC | HEX | OCT | BIN |
|---|---|---|---|
| 0 | 00 | 00 | 0000 |
| 1 | 01 | 01 | 0001 |
| 2 | 02 | 02 | 0010 |
| 3 | 03 | 03 | 0011 |
| 4 | 04 | 04 | 0100 |
| 5 | 05 | 05 | 0101 |
| 6 | 06 | 06 | 0110 |
| 7 | 07 | 07 | 0111 |
| 8 | 08 | 10 | 1000 |
| 9 | 09 | 11 | 1001 |
| 10 | 0A | 12 | 1010 |
| 11 | 0B | 13 | 1011 |
| 12 | 0C | 14 | 1100 |
| 13 | 0D | 15 | 1101 |
| 14 | 0E | 16 | 1110 |
| 15 | 0F | 17 | 1111 |