"Hi" → binary — binary and text

introtwo bytes, ASCII

Answer

01001000 01101001

Why this example is worth doing

The shortest useful conversion on the page, and the one that establishes the format: one byte per character, eight bits each, spaces between bytes. H is 72 and i is 105 in ASCII, and the page prints the decimal and hex codes alongside so the three notations are visibly the same value. Everything else on this page is this operation repeated, so it is worth getting the layout right here.

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
HU+00487248010010000xxxxxxx
iU+006910569011010010xxxxxxx
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