Hex Dec Bin Converter

Convert between hexadecimal, decimal, binary, and octal numbers instantly. Interactive bit toggle interface with support for signed numbers and different bit widths.

2
10
16
8

How to Use the Hex Dec Bin Converter?

The Hex Dec Bin Converter is a comprehensive tool for converting between different number systems: hexadecimal (base-16), decimal (base-10), binary (base-2), and octal (base-8). It features an interactive bit toggle interface and supports various number formats including signed integers.

Key features:
- Real-time conversion between all four number systems
- Interactive bit toggle for visual representation
- Support for signed numbers (8-bit, 16-bit, 32-bit, 64-bit)
- Automatic two's complement handling for negative numbers
- URL parameter support for sharing conversions
- Clean, intuitive interface

What are the different number systems supported?

The converter supports four main number systems:
- Binary (base-2): Uses only 0 and 1
- Octal (base-8): Uses digits 0-7
- Decimal (base-10): Uses digits 0-9 (standard numbering)
- Hexadecimal (base-16): Uses digits 0-9 and letters A-F

Each system represents the same value in different ways, making it easier to work with different contexts in computing and mathematics.

How does the bit toggle interface work?

The bit toggle interface provides a visual representation of binary numbers:
- Each checkbox represents one bit (0 or 1)
- Bit positions are numbered from right to left (0, 1, 2, ...)
- Checking a box sets that bit to 1, unchecking sets it to 0
- The bit width changes based on the selected format (8, 16, 32, or 64 bits)
- Changes in the bit toggle automatically update all number fields
- This is particularly useful for understanding binary representation and bit manipulation.

What are signed numbers and two's complement?

Signed numbers can represent both positive and negative values:
- The leftmost bit (most significant bit) indicates the sign
- 0 = positive, 1 = negative
- Two's complement is used for negative numbers: invert all bits and add 1
- For example, in 8-bit: -1 = 11111111, -2 = 11111110
- The converter automatically handles two's complement conversion
- Different bit widths (8, 16, 32, 64) determine the range of representable values.

How do I convert between different number systems?

Converting between number systems:
1. Enter a value in any of the four input fields (Binary, Decimal, Hex, Octal)
2. All other fields will automatically update with the equivalent values
3. Use the bit toggle to manually set individual bits
4. Change the number format to work with different bit widths
5. The converter handles both positive and negative numbers correctly

Example: Enter '255' in decimal → Binary: '11111111', Hex: 'FF', Octal: '377'

What is the range of values for different bit widths?

The range depends on whether you're using signed or unsigned numbers:

Unsigned (Number format):
- 8-bit: 0 to 255
- 16-bit: 0 to 65,535
- 32-bit: 0 to 4,294,967,295
- 64-bit: 0 to 18,446,744,073,709,551,615

Signed:
- 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,223,372,036,854,775,808 to 9,223,372,036,854,775,807

Number System Conversion Table

Decimal Binary Octal Hex
0 0 0 0
1 1 1 1
2 10 2 2
3 11 3 3
4 100 4 4
5 101 5 5
6 110 6 6
7 111 7 7
8 1000 10 8
9 1001 11 9
10 1010 12 A
15 1111 17 F
16 10000 20 10
255 11111111 377 FF
256 100000000 400 100