In computer science, the sign bit is a bit in a signed number representation that indicates the sign of a number. Although only signed numeric data types have a sign bit, it is invariably located in the most significant bit position, so the term may be used interchangeably with "most significant bit" in some contexts.

Almost always, if the sign bit is 0, the number is non-negative (positive or zero).

Sign bit weight in Two's complement

{| class="wikitable" style="margin-left: auto; margin-right: auto; border: none;"

|+

!Bits

!Value using Two's complement

|-

|

| 0

|-

|

| 1

|-

|

| 7

|-

|

| −8

|-

|

| −7

|-

|

| −1

|}

Two's complement is by far the most common format for signed integers. In Two's complement, the sign bit has the weight where w is equal to the bits position in the number.

</references>