Binary, Decimal & Hex Converter

Convert whole numbers between binary, octal, decimal and hexadecimal exactly, with optional 8/16/32/64-bit two's complement and place-value working.

Interactive calculator · Method NUMBER-BASE-1.0 · Last reviewed: 2026-11-04

Calculate your scenario

Each digit is multiplied by its base raised to the digit's position (counting from 0 at the right) and the products are added; the total is then rewritten in bases 2, 8, 10 and 16.

Your inputs

Try an example

Default worked example. Edit the inputs to calculate your scenario.

Default worked example

Decimal 11
Binary 1011
Octal 13
Hexadecimal B
Bit length 4 bits
Bit pattern as unsigned decimal 11

Place values: 11 = 2^3 + 2^1 + 2^0 = 11.

How to use the calculator

Type the number, choose the base it is written in, and pick unsigned or a two's complement width if you need the signed bit pattern.

What the result means

Decimal 11 is 1011 in binary (8 + 2 + 1), 13 in octal and B in hexadecimal, and needs 4 bits.

Formula and units

Each digit is multiplied by its base raised to the digit's position (counting from 0 at the right) and the products are added; the total is then rewritten in bases 2, 8, 10 and 16. In two's complement mode with width w, a negative value v is stored as the pattern v + 2^w.

Worked examples

Decimal 11 to binary and hex: Whole number to convert: 11 digits; Entered in base: 10; Signed mode: u.
Example result: Decimal: 11; Binary: 1011; Octal: 13; Hexadecimal: B; Bit length: 4 bits; Bit pattern as unsigned decimal: 11.

Hex FF as a signed 8-bit byte: Whole number to convert: FF digits; Entered in base: 16; Signed mode: 8.
Example result: Decimal: -1; Binary: 1111 1111; Octal: 377; Hexadecimal: FF; Bit length: 8-bit word; value needs 1 bit signed; Bit pattern as unsigned decimal: 255.

Limitations and common mistakes

Whole numbers only, up to 2^256 in magnitude; fractions are rejected rather than rounded. Arithmetic is exact (no floating point). In two's complement mode, a decimal entry or any entry with a minus sign is read as a signed value (it must fit from −2^(w−1) to 2^(w−1) − 1); a binary, octal or hex entry without a sign is read as a raw w-bit pattern. Spaces, underscores and commas are ignored; 0b, 0o and 0x prefixes are accepted for their own base.

Reading a hex pattern such as FF as 255 when the system stores it as a signed 8-bit byte, where it means −1.

Sources and assumptions

Method NUMBER-BASE-1.0; last formula review 2026-11-04. Sources and their supported claims. Calculation methodology.