Checking a signed two’s-complement interpretation
The integer base converter turns FF into 255. Reading the same eight bits as a signed number takes one more step, and that step depends on the bit width.
One bit pattern, two different numbers
A string such as FF is only a pattern of digits until someone says how to read it. Read as an unsigned hexadecimal number, FF is 15 × 16 + 15 = 255. Read as an eight-bit two's-complement value, the same pattern means -1. Neither reading is wrong. They answer different questions, and a debugger, a file format specification or a datasheet normally tells you which one applies. The integer base converter answers only the first question. It parses the characters you type as a number in the chosen base and prints that number in another base, so FF in base 16 always comes out as 255 in base 10, whatever the data once represented. The decision about meaning always sits outside the converter, in the specification of the system that produced the bytes, and it has to be made before the number is used for anything.
Why the converter does not guess the sign
The converter accepts a leading minus sign, so -1 in base 16 is simply negative one, written -1 in base 10. That is the sign-and-magnitude convention: a sign character followed by digits. A two's-complement pattern has no sign character. The sign is folded into the leading bit, and the number of bits decides how that bit is weighted. The text FF could be an eight-bit register, the low byte of a longer word, or a plain unsigned count of 255 items, and nothing in the characters says which. A converter that guessed would be wrong for some of those inputs, so this one leaves the width out of its contract on purpose.
The subtraction that supplies the sign
For an n-bit pattern, take the unsigned value u. If the leading bit is 0, which means u is below 2 to the power n minus 1, the signed value is u. If the leading bit is 1, the signed value is u - 2 to the power n. For eight bits the modulus is 2 to the eighth, which is 256. FF gives 255 - 256 = -1, as the second case below the article shows with the basic calculator. The leading bit has weight -128 instead of +128, which is the same statement in positional form: 11111111 equals -128 + 64 + 32 + 16 + 8 + 4 + 2 + 1, and the sum is -1.
What the eight-bit range looks like
Eight bits hold 256 patterns. Under the two's-complement reading, 00 through 7F map to 0 through 127, and 80 through FF map to -128 through -1. The range is not symmetric, because zero takes one of the non-negative patterns. Take 80: the converter gives 128, and 128 - 256 = -128, the most negative eight-bit value. Take F6: the converter gives 246, and 246 - 256 = -10. The two checks at the end of this page confirm both conversions. A pattern whose first hexadecimal digit is 8 through F has the leading bit set in an eight-bit reading, so a quick glance at that digit tells you whether to expect a negative result.
Changing the width changes the answer
The modulus follows the width, so the same trailing digits can mean different numbers. FF is -1 in eight bits but 255 in sixteen bits, because in a sixteen-bit pattern 00FF has a leading bit of 0. In sixteen bits, FFFE converts to 65534 and the modulus is 65536, so the signed value is 65534 - 65536 = -2. Padding with leading zeros therefore changes the signed meaning, while padding with leading ones (sign extension) preserves it. This is why a byte read from a file must be extended correctly before it is used in wider arithmetic, and why a worksheet that states the width first avoids a whole family of off-by-256 mistakes.
The invert-and-add-one rule
Textbooks often describe two's complement as a negation procedure: to write -k, invert every bit of k and add one. For -1 in eight bits, start from 00000001, invert to 11111110, add one and get 11111111, which is FF. The procedure and the subtraction rule agree because inverting all n bits of k gives 2 to the n minus 1 minus k, and adding one gives 2 to the n minus k, which is the same as -k modulo 2 to the n. The subtraction form is easier to check on a calculator, and the rule form is easier to carry out by hand on a short bit string.
Where signed bit patterns appear in practice
Nearly every current processor stores signed integers in two's complement, and the C language standard made that representation mandatory with C23, after decades in which it was merely the usual choice. Hex dumps, network captures, microcontroller registers and sensor datasheets all show raw bytes that may represent signed readings. A temperature sensor that reports F6 in an eight-bit signed register is reporting -10 in whatever unit the datasheet names, not 246. Reading the datasheet for the register width and signedness comes before any conversion, and the converter then supplies the unsigned value that the subtraction starts from. Signed bytes also appear in audio samples, image difference buffers and offsets stored in binary file formats, so the same two-step reading applies well beyond registers.
What this check covers and what it leaves open
The worksheet defines its own interpretation: eight bits, signed, subtract 256 when the leading bit is set. It does not detect a bit width from the text, and it does not handle one's complement, sign-and-magnitude storage, floating-point formats or byte order. A value that spans several bytes also needs the correct byte order before it is converted. If the source states a different width, repeat the two steps with that width: convert to unsigned, then subtract 2 to the power of the width when the leading bit is 1. Both cases below use whole numbers, so the arithmetic is exact.
Binary input gives the same answer as hex
Hexadecimal is shorthand for binary, with each hex digit standing for four bits. The converter therefore accepts the pattern in either base. Typing 11111111 with the source base set to 2 returns 255, the same value that FF in base 16 returns, and 1111 1111 grouped into two nibbles is simply F followed by F. If a datasheet shows a register as binary, you can convert it directly. If it shows hex, you can expand each digit mentally: 8 is 1000, F is 1111, 6 is 0110. Expanding to bits is also the quickest way to see the leading bit, and the leading bit is the only thing the signed reading adds to the unsigned value.
Try your own values with the Fixed-width integer representation calculator.
Reproduce the checks
Unsigned pattern value
Open the Integer Base Converter and enter:
- Value
FF- Source base
16- Target base
10
Expected output:
Value
255No fixed-width sign interpretation is applied by the converter.
Eight-bit signed interpretation
Open the Basic calculator and enter:
- First number
255- Operation
subtract- Second number
256
Expected output:
Result
-1The leading signed bit requires subtracting two to the eighth.
References and implementation scope
The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.
Sources
- Primary definition and convention reference ↗ · 2026-10-08