"a" vs "A" — the case bit — binary and text

coreone bit apart

Answer

01000001 01100001

Why this example is worth doing

The two encodings differ in exactly one bit, and the page puts them one above the other so the single differing column is unmissable. This is the design decision behind the ASCII layout — the alphabet was positioned so that case is a single bit — and it is a good example of an encoding chosen to make a common operation cheap. The XOR of the two bytes is 0010 0000, which is 32.

Try your own input in the Binary ⇄ text / ASCII. Convert text to binary and back, byte by byte, with the full UTF-8 breakdown.

How the answer is reached

ASCII encoding of 2 characters

ASCII: one byte per character, the high bit always zero.

ASCII encoding of 2 characters — columns character, code point, decimal, hex, binary, template
charactercode pointdecimalhexbinarytemplate
AU+00416541010000010xxxxxxx
aU+00619761011000010xxxxxxx
Three different numbers; the UI must show all three — ASCII encoding of 2 characters
countvalue
bytes2
code points2
UTF-16 code units2

Compare with

Open this example in the Binary ⇄ text / ASCII

The field arrives filled in with this example’s input.

Note:

Notation this page assumes

  • Bit strings are written most significant bit first, and bit 0 is the least significant bit.
  • A width is stated explicitly wherever it changes the answer; nothing is silently sign-extended or truncated.
  • ASCII is the 7-bit set padded to one byte; UTF-8 is shown byte by byte, so a non-ASCII character is more than eight bits.

Sources

  • ANSI X3.4 / ISO-IEC 646, the ASCII character set
  • The Unicode Standard, Annex on the UTF-8 encoding form