Developer Tools
Excess-N converter.
Encode a signed number as excess-K (biased or offset binary) and decode it back. Presets for IEEE 754 style biases like 127 and 1023, offset binary, and a custom bias, plus excess-3 digit code. Runs in your browser.
Input
Result
Enter a value, then press Calculate.
How excess-N (biased) binary works
- Add a bias: to store a value, add a fixed number K and write the result as a plain unsigned n-bit number. To read it, subtract K.
- Range: -K to 2n-1-K. In excess-127 at 8 bits that is -127 to 128.
- Why bother: stored patterns sort in the same order as the values they represent, so a plain unsigned comparison works on negative numbers too.
- Offset binary: K = 2n-1 (128 for 8 bits). It looks like two's complement with the sign bit flipped.
- Floating point: IEEE 754 stores the exponent with a bias of 15 (binary16, 5 bits), 127 (binary32, 8 bits) and 1023 (binary64, 11 bits), which is K = 2n-1-1.
Worked examples
| Value | Bias | Stored bits |
|---|---|---|
| 0 | 127, 8 bits | 01111111 |
| 1 | 127, 8 bits | 10000000 |
| -126 | 127, 8 bits | 00000001 |
| -128 | 128, 8 bits | 00000000 |
| 0 | 1023, 11 bits | 01111111111 |
Excess-3 code
Excess-3 is a decimal digit code: each digit d is stored as d + 3 in 4 bits, so 0 is 0011 and 9 is 1100. 59 becomes 1000 1100. Inverting every bit of an excess-3 digit gives the 9's complement of the digit (the digit subtracted from 9). Compare with ordinary BCD.
See also IEEE 754 Float Converter, two's complement and the Binary Converter. Uses BigInt, so 64-bit values are exact. Nothing is sent anywhere.
FAQ
What is excess-127?
Excess-127 stores a number as value + 127 in 8 bits, so 0 is 01111111 and 1 is 10000000. IEEE 754 single precision uses it for the exponent field.
What is the difference between excess-127 and excess-128?
Excess-127 (K = 2^(n-1) - 1) covers -127 to 128 in 8 bits and is the floating-point convention. Excess-128 (K = 2^(n-1)), also called offset binary, covers -128 to 127 and matches the range of two's complement.
How do I decode an excess-N number?
Read the bits as an ordinary unsigned binary number, then subtract the bias. For 10000000 in excess-127: 128 - 127 = 1.
What is excess-3 code?
A 4-bit code for decimal digits where each digit is stored as digit + 3. It uses 0011 to 1100 and is self-complementing: flipping the bits gives the 9's complement digit.
Does the tool use the bias IEEE 754 uses?
The first preset, 2^(n-1) - 1, gives 15, 127 and 1023 for 5, 8 and 11 bits, which are the exponent biases of binary16, binary32 and binary64. Reserved exponent patterns (all zeros and all ones) are not special-cased here: this is a plain integer converter.
Sources
Sources retrieved October 2026.