All calculators

Binary, Decimal & Hex Converter

Convert binary, decimal, hexadecimal and octal. Flip bits, inspect nibbles and compare signed integers through 64 bits.

Enter your values

Try an example

Your result

HexadecimalAC
Binary
10101100
Octal
254
Decimal
172
Allowed decimal range
0 … 255

Calculated

Every four bits make one hex digit
MOST SIGNIFICANTLEAST SIGNIFICANT
Nibble 1A
Nibble 0C

Click a bit to toggle it. Bits are numbered from zero on the right.

How this answer is calculated

These steps use your current values. Change an input to follow a different calculation.

  1. 1

    Group the stored bits

    1010 1100 → A C
  2. 2

    Add the weights of the 1s

    128 + 32 + 8 + 4 = 172
  3. 3

    Apply the selected interpretation

    0 ≤ 172 ≤ 255

How to use this on a job

A drive manual says bit 7 is set. Your watch table says −84. The packet capture says AC. These can all describe the same byte. Start with the stored bits, then decide how the software should interpret them.

  1. 01

    Choose the input format, output format and register width. Enter digits without a radix prefix; spaces or underscores may separate binary, octal or hexadecimal groups.

  2. 02

    Use unsigned for masks and status words. Use signed when the source explicitly declares a signed integer. Decimal input must fit that interpretation; other bases describe the stored pattern.

  3. 03

    Flip a bit in the diagram. Its position tells you its weight: bit 0 is worth 1, bit 1 is worth 2, and bit 7 is worth 128. Group four bits at a time to read hexadecimal.

Work through one example

172 = 10 × 16 + 12

1010 1100 has two nibbles: 1010 = A and 1100 = C. Its unsigned value is 128 + 32 + 8 + 4 = 172. With 8-bit two’s-complement interpretation, subtract 256 to obtain −84. Change to signed without changing the bits to see that distinction.

Before you trust the answer

Changing the width can change the meaning. FF is −1 as a signed 8-bit pattern but +255 in a signed 16-bit register. This converter rejects overflow; it does not silently drop high bits. Decimal signed values and unsigned hexadecimal patterns are deliberately different input conventions.

Binary to hexadecimal lookup

The highlighted rows match the nibbles in your current value.

DecimalBinary nibbleHex digit
000000
100011
200102
300113
401004
501015
601106
701117
810008
910019
101010A
111011B
121100C
131101D
141110E
151111F

Questions that come up on the job

How do I convert binary to hex by hand?

Start at the right and split the number into groups of four. Add zeros at the left if needed. Convert each group with the table: 1010 is A, 1100 is C, so 10101100 is AC. You do not need to convert the whole number to decimal first.

Is a byte the same as a binary number?

A byte is a size: eight bits. Binary, decimal and hex are ways to write a value. The byte 11111111 can be written as FF in hex or 255 in unsigned decimal. Two hex digits are enough to write any byte.

Why does FF sometimes mean −1?

With an 8-bit signed integer, the top bit has a negative weight. The stored pattern FF is 255 unsigned; subtract 256 to read it as −1 signed. The same FF in a 16-bit signed register is 00FF, which is +255. Always check both width and interpretation.

TRYPLC FIELD REFERENCE / 01

Binary, Decimal & Hex Converter

Convert binary, decimal, hexadecimal and octal. Flip bits, inspect nibbles and compare signed integers through 64 bits.

  • 4 bits = 1 nibble
  • 8 bits = 1 byte
  • 1 hex digit = 4 bits
  • Unsigned range: 0 to 2ⁿ − 1
  • Signed range: −2ⁿ⁻¹ to 2ⁿ⁻¹ − 1
MOST SIGNIFICANTLEAST SIGNIFICANT
Nibble 1A
Nibble 0C

How to use this on a job

A drive manual says bit 7 is set. Your watch table says −84. The packet capture says AC. These can all describe the same byte. Start with the stored bits, then decide how the software should interpret them.

  1. 01

    Choose the input format, output format and register width. Enter digits without a radix prefix; spaces or underscores may separate binary, octal or hexadecimal groups.

  2. 02

    Use unsigned for masks and status words. Use signed when the source explicitly declares a signed integer. Decimal input must fit that interpretation; other bases describe the stored pattern.

  3. 03

    Flip a bit in the diagram. Its position tells you its weight: bit 0 is worth 1, bit 1 is worth 2, and bit 7 is worth 128. Group four bits at a time to read hexadecimal.

Work through one example

172 = 10 × 16 + 12

1010 1100 has two nibbles: 1010 = A and 1100 = C. Its unsigned value is 128 + 32 + 8 + 4 = 172. With 8-bit two’s-complement interpretation, subtract 256 to obtain −84. Change to signed without changing the bits to see that distinction.

Before you trust the answer

Changing the width can change the meaning. FF is −1 as a signed 8-bit pattern but +255 in a signed 16-bit register. This converter rejects overflow; it does not silently drop high bits. Decimal signed values and unsigned hexadecimal patterns are deliberately different input conventions.

https://tryplc.com/tools/number-converter