Binary / Decimal / Hex Converter
Convert between binary, decimal, hexadecimal & octal · step-by-step · IEEE 754 · bitwise · ASCII
Type in any field — all others update instantly. Paste 0x, 0b, or 0o prefixes for auto-detection.
Enter a number in the Converter tab first — all sections below update automatically.
Step-by-Step Conversion Breakdown
Enter a number in any field above to see the step-by-step breakdown.
Bit-Width Analysis & Two's Complement
Enter a number in the Converter tab to see bit-width analysis.
IEEE 754 Single-Precision Float (32-bit)
Enter a decimal number above to see its IEEE 754 representation.
Bitwise Operations (AND · OR · XOR · NOT · Shifts)
Enter numbers A and B above to see bitwise results.
ASCII Character Lookup
Enter a character or ASCII code above.
ASCII Reference Table (0–255)
| Dec | Hex | Binary | Char |
|---|
Binary, Decimal, Hex & Octal — The Four Number Systems
Computers represent all data in binary (base 2), but engineers frequently need to read values in hexadecimal (base 16) for compactness, decimal (base 10) for human-readability, or octal (base 8) for UNIX permissions and legacy systems. This converter handles all four bases simultaneously — type in any field and the other three update instantly.
How to Use This Converter
- Type a number in any of the four fields — Decimal, Binary, Hex, or Octal.
- Paste with a prefix:
0xFFauto-detects hex,0b1010binary,0o17octal. - Use the Advanced tab for step-by-step breakdowns, two's complement, IEEE 754 float representation, bitwise operations, and the full ASCII table.
- Click the copy icon next to any field to copy the value to your clipboard.
- Negative numbers are supported — prefix with a minus sign.
Key Conversion Formulas
Decimal → Binary (divide by 2)
Repeatedly divide the decimal number by 2, recording the remainder at each step. Read the remainders from bottom to top to get the binary representation.
Example: 13 → 1101₂ (13÷2=6 r1, 6÷2=3 r0, 3÷2=1 r1, 1÷2=0 r1 → read bottom-up: 1101)
Binary → Decimal (positional weights)
Multiply each bit by its positional weight (2^n, where n is the bit position from the right, starting at 0) and sum all contributions.
Example: 1101₂ = 1×2³ + 1×2² + 0×2¹ + 1×2⁰ = 8 + 4 + 0 + 1 = 13
Hex ↔ Binary (groups of 4 bits)
Each hex digit maps directly to exactly 4 binary bits (a nibble). No arithmetic needed — substitute each hex digit with its 4-bit binary equivalent.
| Hex | Decimal | Binary (4-bit) |
|---|---|---|
| 0 | 0 | 0000 |
| 4 | 4 | 0100 |
| 8 | 8 | 1000 |
| A | 10 | 1010 |
| F | 15 | 1111 |
| FF | 255 | 1111 1111 |
What is Two's Complement?
Two's complement is the standard way computers represent signed integers. To negate a number: invert all bits (one's complement), then add 1. An 8-bit signed integer ranges from −128 to +127; unsigned from 0 to 255. The Advanced tab shows the two's complement representation for 8, 16, 32, and 64-bit widths.
IEEE 754 Floating Point
The IEEE 754 standard defines how floating-point numbers are stored in binary. A 32-bit (single-precision) float uses 1 sign bit, 8 exponent bits, and 23 mantissa bits. The Advanced tab visualises the exact bit layout for any decimal number you enter, including the biased exponent value.