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.
Convert binary to hex and inspect a fixed-point word
Translate a word, decode its byte order, or check what a signed or unsigned format stores.
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
- Big-endian bytes
- F6 80
- Little-endian bytes
- 80 F6
Review and export the exact word ledger
| Bit | Role | Value | Weight | Contribution |
|---|---|---|---|---|
| 15 | Sign | 1 | -128 | -128 |
| 14 | Whole | 1 | 64 | 64 |
| 13 | Whole | 1 | 32 | 32 |
| 12 | Whole | 1 | 16 | 16 |
| 11 | Whole | 0 | 8 | 0 |
| 10 | Whole | 1 | 4 | 4 |
| 9 | Whole | 1 | 2 | 2 |
| 8 | Whole | 0 | 1 | 0 |
| 7 | Fraction | 1 | 1/2 | 1/2 |
| 6 | Fraction | 0 | 1/4 | 0 |
| 5 | Fraction | 0 | 1/8 | 0 |
| 4 | Fraction | 0 | 1/16 | 0 |
| 3 | Fraction | 0 | 1/32 | 0 |
| 2 | Fraction | 0 | 1/64 | 0 |
| 1 | Fraction | 0 | 1/128 | 0 |
| 0 | Fraction | 0 | 1/256 | 0 |
How to use this calculator
- Choose binary, hexadecimal, bytes or decimal input and enter the value.
- Set the word width, signed interpretation and fractional bits. For bytes, select the order in which the tokens were entered.
- Compare the integer and fixed-point values, the representable range and the encoding error when applicable.
- Select a bit to flip it. The chart shows its role, exact weight and contribution.
- 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
Repeating Decimal Calculator & Remainder Cycle
Convert repeating decimals to reduced fractions or find the shortest decimal period of a fraction. Trace the exact remainders and inspect any digit.
Rounding & Precision Planner
Compare seven rounding rules, decimal places, increments and significant figures. Visualize error, reconcile rounded totals and export an exact dataset audit.
Rational Approximation & Denominator Budget Calculator
Find the closest fraction under a denominator cap, compare exact lower and upper choices, and calculate the smallest denominator that meets your error tolerance.
Online Calculator
Use this Online Calculator as a fully interactive scientific calculator with memory, trigonometry, powers, roots, and advanced math operations.
