Binary Converter

Convert batches between binary, decimal, hexadecimal and octal, including signed bit widths.

About this tool

Convert batches of binary, decimal, hexadecimal and octal integers on one screen. Select an 8-, 16-, 32- or 64-bit width and choose unsigned values or signed two’s-complement interpretation.

Use this tool step by step

  1. Choose the input base and bit width, then enter one integer per line. Select signed mode for negative decimal inputs or two’s-complement bit patterns.
  2. Calculate to see decimal, binary, hexadecimal and octal together. Expand the comparison to read the same bits as signed and unsigned decimal values.

How the calculation works

Value = sum(digit × base^position). For a signed w-bit value, range is −2^(w−1) through 2^(w−1)−1. A negative value is encoded as value + 2^w; a non-decimal bit pattern with its sign bit set decodes as encoded value − 2^w.

Worked example

In signed 8-bit mode, decimal −1 becomes binary 11111111, hexadecimal FF and octal 377. Unsigned decimal 42 becomes binary 00101010 and hexadecimal 2A.

How does a 16-bit binary number change between signed and unsigned?

The 16-bit pattern 1111111111111111 (hex FFFF) is 65,535 unsigned. Its first bit is 1, so its signed two’s-complement value is 65,535 minus 65,536, or −1. Hex 8000 similarly means 32,768 unsigned or −32,768 signed. At 7FFF the first bit is 0, so both readings are 32,767.

Read hexadecimal as a signed 32-bit integer

Enter FFFFFFFE as hexadecimal and set Bit width to 32. The same 32 bits read as 4,294,967,294 unsigned or −2 signed. Choose the interpretation that matches the field you are reading.

The highest bit is 1. To read the pattern as 32-bit two’s complement, subtract 2^32 (4,294,967,296) from the unsigned value. That changes the decimal interpretation while keeping the binary and hexadecimal digits the same.

Load FFFFFFFE as signed

Load FFFFFFFE as unsigned

Oracle reference for signed and unsigned 32-bit integers

Convert little-endian hex bytes to binary and decimal

Select Hex bytes (little-endian) when the bytes appear least significant first, as they do in some memory displays. Enter exactly the number of bytes in the selected bit width. You can paste them with spaces or without separators.

For 32 bits, enter 78 56 34 12 to get hex 12345678 and decimal 305419896. Open Compare byte order to view 12 34 56 78 in big-endian order and 78 56 34 12 in little-endian order. Signed interpretation is applied to the resulting bit pattern.

Run the little-endian 32-bit example

Oracle reference for big-endian and little-endian byte order

Convert decimal to binary with a fractional part

Choose Decimal and Fractional numbers. Enter 5.375 to get 101.011 in binary. The positions to the right of the binary point are halves, quarters and eighths. In .011, the quarter plus the eighth equals 0.375.

Some fractions repeat in another base. Decimal 0.1 is 0.0(0011) in binary, where the digits in parentheses repeat. This mode uses exact integer arithmetic to keep track of each remainder. An ellipsis marks a result whose fraction needed more than 64 digits.

Run 5.375 and 0.1 decimal to binary

Run 101.011 binary to decimal

Assumptions and limitations

Fixed-width modes accept whole integers. Choose Fractional numbers for positional fractions. Batch size is 100. Prefixes 0b, 0x and 0o are accepted only for their matching input base. Decimal signed input uses a minus sign; non-decimal signed input is an encoded nonnegative bit pattern. BigInt keeps 64-bit integer arithmetic exact.

Choose the width used by your file format or device. The same FF pattern means 255 unsigned or −1 signed in eight bits; selecting signed mode changes interpretation, not the stored bits.

Common questions

Why does a value fail the width check?

It falls outside the selected signed or unsigned integer range. Increase the width or correct the representation.

Guide updated 2026-11-21. Calculation method and source dates remain separate.

Method reviewed 2026-10-08. Calculation standards · Report an issue