How to use
Pick a direction
Pick Binary, Decimal, Hexadecimal or Octal in Number base and a Character encoding, then press Text to Binary or Binary to Text. Try sample loads Hi!, and Swap sends the output back as new input.
Type or paste your input
Type, paste, press Open .txt or drop a file. The output updates as you type. When encoding, choose a Byte separator, including a custom one, and tick Add 0b prefix if you want it. When decoding, any separator or prefix is accepted.
Check the breakdown and copy
The Character breakdown table lists each character's code point and its bytes in decimal, hex and binary. Click Copy, Save .txt, or Save .bin to download the raw bytes.
Why Text to Binary Converter
- Binary, decimal, hex or octal, in UTF-8, ASCII, UTF-16, Windows-1252 or Latin-1.
- Decodes with spaces, commas, new lines, prefixes or no separators at all.
- Character table shows code point, decimal, hex and binary side by side.
- Open a .txt file and save the result as .txt or raw .bin bytes.
Letters in binary: A to Z and a to z
Each letter below is one byte in both ASCII and UTF-8. Uppercase and lowercase letters differ only in the third bit from the left: 010 for capitals and 011 for small letters. The last five bits give the letter's position in the alphabet, so A and a both end in 00001 and Z and z both end in 11010. That pattern makes it easy to read letters in binary once you know it.
| Letter | Decimal | Binary | Letter | Decimal | Binary |
|---|---|---|---|---|---|
| A | 65 | 01000001 | a | 97 | 01100001 |
| B | 66 | 01000010 | b | 98 | 01100010 |
| C | 67 | 01000011 | c | 99 | 01100011 |
| D | 68 | 01000100 | d | 100 | 01100100 |
| E | 69 | 01000101 | e | 101 | 01100101 |
| F | 70 | 01000110 | f | 102 | 01100110 |
| G | 71 | 01000111 | g | 103 | 01100111 |
| H | 72 | 01001000 | h | 104 | 01101000 |
| I | 73 | 01001001 | i | 105 | 01101001 |
| J | 74 | 01001010 | j | 106 | 01101010 |
| K | 75 | 01001011 | k | 107 | 01101011 |
| L | 76 | 01001100 | l | 108 | 01101100 |
| M | 77 | 01001101 | m | 109 | 01101101 |
| N | 78 | 01001110 | n | 110 | 01101110 |
| O | 79 | 01001111 | o | 111 | 01101111 |
| P | 80 | 01010000 | p | 112 | 01110000 |
| Q | 81 | 01010001 | q | 113 | 01110001 |
| R | 82 | 01010010 | r | 114 | 01110010 |
| S | 83 | 01010011 | s | 115 | 01110011 |
| T | 84 | 01010100 | t | 116 | 01110100 |
| U | 85 | 01010101 | u | 117 | 01110101 |
| V | 86 | 01010110 | v | 118 | 01110110 |
| W | 87 | 01010111 | w | 119 | 01110111 |
| X | 88 | 01011000 | x | 120 | 01111000 |
| Y | 89 | 01011001 | y | 121 | 01111001 |
| Z | 90 | 01011010 | z | 122 | 01111010 |
Digits, space and punctuation in binary
Digits run from 48 to 57, so the last four bits of each digit are the digit itself in binary: 5 is 0011 0101. The space character is 32, which is why sentences in binary have so many bytes starting with 0010.
| Character | Decimal | Binary |
|---|---|---|
| 0 | 48 | 00110000 |
| 1 | 49 | 00110001 |
| 2 | 50 | 00110010 |
| 3 | 51 | 00110011 |
| 4 | 52 | 00110100 |
| 5 | 53 | 00110101 |
| 6 | 54 | 00110110 |
| 7 | 55 | 00110111 |
| 8 | 56 | 00111000 |
| 9 | 57 | 00111001 |
| Space | 32 | 00100000 |
| ! | 33 | 00100001 |
| ' | 39 | 00100111 |
| , | 44 | 00101100 |
| - | 45 | 00101101 |
| . | 46 | 00101110 |
| ? | 63 | 00111111 |
| @ | 64 | 01000000 |
Worked example: converting Hi to binary by hand
Start with each character's code. H is 72 and i is 105. To write 72 in binary, subtract the largest power of two that fits and repeat: 72 is 64 plus 8, so bits 64 and 8 are on. Written across the eight places 128, 64, 32, 16, 8, 4, 2, 1, that gives 01001000.
Do the same for 105: 64 plus 32 plus 8 plus 1, which gives 01101001. Put them together with a space and Hi in binary is 01001000 01101001.
To check your work, click Binary to Text, paste your answer and see whether Hi comes back. If one bit is wrong you will get a different letter, which makes it easy to find the mistake. The Character breakdown table under the panes shows the same working for any text you type.