Binary to Hex Calculator & Fixed-Point Word Inspector

Set the word width, signed interpretation and number of fractional bits. Convert binary and hexadecimal patterns, interpret a sequence of bytes, or encode your decimal with a specified rounding policy. Edit individual bits and see their exact contributions.

Word and byte inspection

Convert binary to hex and inspect a fixed-point word

The 16-bit word decodes to 0xF680.

Shorter bit patterns are padded with zeros on the left. Spaces and underscores are allowed.

Hexadecimal and binary

0xF680

11110110 10000000

Integer interpretations

Unsigned 63104

Signed -2432

Fixed-point value

-9.5

Signed · 8 fractional bits

Range and quantization

Minimum
-128
Maximum
127.99609375
Step size
0.00390625

Edit the bits by significance

Select a bit to flip it and edit the word in binary mode. A set bit contributes its labeled weight to the fixed-point value.

  • Sign
  • Whole
  • Fraction
Byte 1 · 0xF6
Byte 2 · 0x80
Big-endian bytes
F6 80
Little-endian bytes
80 F6
Review and export the exact word ledger
Exact bit weights and contributions
BitRoleValueWeightContribution
15Sign1-128-128
14Whole16464
13Whole13232
12Whole11616
11Whole080
10Whole144
9Whole122
8Whole010
7Fraction11/21/2
6Fraction01/40
5Fraction01/80
4Fraction01/160
3Fraction01/320
2Fraction01/640
1Fraction01/1280
0Fraction01/2560

How to use this calculator

  1. Choose binary, hexadecimal, bytes or decimal input and enter the value.
  2. Set the word width, signed interpretation and fractional bits. For bytes, select the order in which the tokens were entered.
  3. Compare the integer and fixed-point values, the representable range and the encoding error when applicable.
  4. Select a bit to flip it. The chart shows its role, exact weight and contribution.
  5. Open the exact ledger or download a CSV with both byte layouts and bit weights.

The Formula

The mathematical logic powering this calculation is:

Each hexadecimal digit covers four binary digits. Read the word from highest to lowest bit position. At word width W, the unsigned integer U is the sum of each set bit's 2ⁱ weight. The two's-complement integer uses U when the highest bit is clear and U − 2ᵂ when it is set. By default, shorter binary and hexadecimal literals are padded with leading zeros. Enter all bits or hex digits explicitly to represent a larger sign-extended pattern.

In Hex bytes mode, supply exactly W ÷ 8 two-digit byte tokens in the order they appear. Big-endian begins with the most significant byte. Little-endian begins with the least significant byte. Bit order within each byte stays the same. Both byte layouts are shown for the same logical word.

For F fractional bits, divide the chosen integer interpretation by 2ᶠ. The value increment is 2⁻ᶠ. Bit i contributes 2ⁱ⁻ᶠ when set, except that the top bit has negative weight in the signed interpretation. With signed selection, the integer range is −2ᵂ⁻¹ to 2ᵂ⁻¹ − 1. With unsigned selection it is 0 to 2ᵂ − 1. Scale these bounds the same way.

For decimal encoding, multiply the exact requested number by 2ᶠ. Round to the nearest integer with even ties or truncate toward zero. Even ties choose the even signed integer on either side of an exact midpoint. The resulting integer must fit the selected signed or unsigned range. Values whose rounded integer is out of range leave the word unavailable. The signed encoding error equals the stored fixed-point value minus the requested decimal.

Choose 8, 16, 24, 32 or 64 bits and up to W − 1 fractional bits. A requested decimal can have up to 24 whole and 24 fractional digits. Arithmetic and the audit CSV use exact integers and rational fractions. The tool decodes the width, byte order, signedness and scale you enter. Confirm those settings for the data source you are working with.

Worked Example

If you input:

  • Binary: 11110110 10000000
  • Width: 16 bits
  • Format: Signed, 8 fractional bits

Result:

The word is 0xF680. Its unsigned integer is 63104, signed integer is −2432, and signed fixed-point value is −9.5. Its little-endian bytes are 80 F6.

Frequently Asked Questions

Why does the same hex word have two integer values?

Unsigned adds every bit with positive weight. The two's-complement interpretation gives the highest bit a negative weight. When that bit is clear, the two integers match.

Does little-endian reverse the bits inside each byte?

No. It orders bytes from least to most significant. Each byte keeps its bit order.

Do leading zeros change the value?

Adding zeros within the chosen width keeps the unsigned magnitude. Changing the full word width can move the sign bit and change the signed interpretation.

Why does a decimal change after encoding?

The selected format stores values on a grid spaced by 2 raised to the negative fractional-bit count. The chosen rounding policy selects a grid point.

Will an out-of-range word wrap?

The worksheet leaves the word unavailable when the rounded integer is outside the range. It shows the requested value, rounded integer and available bounds.

Which convention for Q notation does this tool use?

It uses explicit total width and fractional-bit count, so you can map the format from either Q notation convention.

Similar Calculators