# Text to Binary Converter - Binary, Hex, Octal, Decimal and Back

Page: https://hirantha.me/tools/text-to-binary
Part of: Hirantha Sandaruwan Lakshan free tools (https://hirantha.me/tools)
Updated: 2026-10-13

Turn text into binary, hexadecimal, octal or decimal bytes, and bytes back into text. UTF-8 aware, with an ASCII table and clear errors.

This is a free tool that runs in the browser: open the page to use it. File tools process files on the visitor's own device; files are never uploaded or stored. No account, sign-up, payment or watermark.

Type text and see the bytes behind it in binary, hexadecimal, octal or decimal, or paste bytes and read the text they spell. The conversion uses UTF-8, the encoding of almost every web page, so the letter A is one byte (01000001) and the letter é is two (11000011 10101001). Mistakes in pasted code are reported with their position instead of being quietly repaired. It all runs in your browser and nothing is sent anywhere.

How to read binary. A byte is eight bits, and each bit is worth a power of two: 128, 64, 32, 16, 8, 4, 2, 1 from left to right. Add up the places that hold a 1. The byte 01000001 has a 1 in the 64 place and the 1 place, so it is 65, which is the letter A. The two bytes 01001000 01101001 are 72 and 105, the letters H and i, so together they spell Hi. Hexadecimal writes the same byte with two digits (41 for 65; 48 69 for Hi), octal with up to three (101) and decimal as a number from 0 to 255.

From text to bytes. The text is cut into characters and each is stored in UTF-8, defined in RFC 3629. A character from U+0000 to U+007F takes one byte and is identical to ASCII. U+0080 to U+07FF takes two bytes, U+0800 to U+FFFF three, and U+10000 to U+10FFFF four. So the letter é (U+00E9) is C3 A9, the euro sign (U+20AC) is E2 82 AC, and the grinning face emoji (U+1F600) is F0 9F 98 80. This tool uses the browser's own TextEncoder, which always produces UTF-8, and lists the first 64 characters one by one so you can see which bytes belong to which character.

From bytes to text. Your groups are read as bytes and then checked against the well-formed UTF-8 sequences before any text is built. Separate the groups with spaces, commas, semicolons or line breaks; each may start with 0b, 0x or 0o. Without separators binary is read eight digits at a time, hexadecimal two and octal three, while decimal needs separators. A digit that does not belong, a group of the wrong length or a decimal over 255 is reported with its group number, line and column. Bytes that are not valid UTF-8, such as a lone C3, are reported with the byte position. They are never swapped for the replacement character, so a mistake cannot hide.

ASCII is the older 7-bit code of 128 values: 33 control codes and 95 printable characters, from the space (32) to the tilde (126). The table on this page lists all 95 in decimal, hexadecimal, octal and binary. Values 128 to 255 are not ASCII, and what they mean depends on the encoding (Latin-1 and Windows-1252 differ), so a byte in that range is accepted here only as part of a valid UTF-8 sequence.

Printable ASCII characters (32 to 126):
| Character | Decimal | Hex | Octal | Binary |
| --- | --- | --- | --- | --- |
| space | 32 | 20 | 040 | 00100000 |
| ! | 33 | 21 | 041 | 00100001 |
| " | 34 | 22 | 042 | 00100010 |
| # | 35 | 23 | 043 | 00100011 |
| $ | 36 | 24 | 044 | 00100100 |
| % | 37 | 25 | 045 | 00100101 |
| & | 38 | 26 | 046 | 00100110 |
| ' | 39 | 27 | 047 | 00100111 |
| ( | 40 | 28 | 050 | 00101000 |
| ) | 41 | 29 | 051 | 00101001 |
| * | 42 | 2A | 052 | 00101010 |
| + | 43 | 2B | 053 | 00101011 |
| , | 44 | 2C | 054 | 00101100 |
| - | 45 | 2D | 055 | 00101101 |
| . | 46 | 2E | 056 | 00101110 |
| / | 47 | 2F | 057 | 00101111 |
| 0 | 48 | 30 | 060 | 00110000 |
| 1 | 49 | 31 | 061 | 00110001 |
| 2 | 50 | 32 | 062 | 00110010 |
| 3 | 51 | 33 | 063 | 00110011 |
| 4 | 52 | 34 | 064 | 00110100 |
| 5 | 53 | 35 | 065 | 00110101 |
| 6 | 54 | 36 | 066 | 00110110 |
| 7 | 55 | 37 | 067 | 00110111 |
| 8 | 56 | 38 | 070 | 00111000 |
| 9 | 57 | 39 | 071 | 00111001 |
| : | 58 | 3A | 072 | 00111010 |
| ; | 59 | 3B | 073 | 00111011 |
| < | 60 | 3C | 074 | 00111100 |
| = | 61 | 3D | 075 | 00111101 |
| > | 62 | 3E | 076 | 00111110 |
| ? | 63 | 3F | 077 | 00111111 |
| @ | 64 | 40 | 100 | 01000000 |
| A | 65 | 41 | 101 | 01000001 |
| B | 66 | 42 | 102 | 01000010 |
| C | 67 | 43 | 103 | 01000011 |
| D | 68 | 44 | 104 | 01000100 |
| E | 69 | 45 | 105 | 01000101 |
| F | 70 | 46 | 106 | 01000110 |
| G | 71 | 47 | 107 | 01000111 |
| H | 72 | 48 | 110 | 01001000 |
| I | 73 | 49 | 111 | 01001001 |
| J | 74 | 4A | 112 | 01001010 |
| K | 75 | 4B | 113 | 01001011 |
| L | 76 | 4C | 114 | 01001100 |
| M | 77 | 4D | 115 | 01001101 |
| N | 78 | 4E | 116 | 01001110 |
| O | 79 | 4F | 117 | 01001111 |
| P | 80 | 50 | 120 | 01010000 |
| Q | 81 | 51 | 121 | 01010001 |
| R | 82 | 52 | 122 | 01010010 |
| S | 83 | 53 | 123 | 01010011 |
| T | 84 | 54 | 124 | 01010100 |
| U | 85 | 55 | 125 | 01010101 |
| V | 86 | 56 | 126 | 01010110 |
| W | 87 | 57 | 127 | 01010111 |
| X | 88 | 58 | 130 | 01011000 |
| Y | 89 | 59 | 131 | 01011001 |
| Z | 90 | 5A | 132 | 01011010 |
| [ | 91 | 5B | 133 | 01011011 |
| \ | 92 | 5C | 134 | 01011100 |
| ] | 93 | 5D | 135 | 01011101 |
| ^ | 94 | 5E | 136 | 01011110 |
| _ | 95 | 5F | 137 | 01011111 |
| ` | 96 | 60 | 140 | 01100000 |
| a | 97 | 61 | 141 | 01100001 |
| b | 98 | 62 | 142 | 01100010 |
| c | 99 | 63 | 143 | 01100011 |
| d | 100 | 64 | 144 | 01100100 |
| e | 101 | 65 | 145 | 01100101 |
| f | 102 | 66 | 146 | 01100110 |
| g | 103 | 67 | 147 | 01100111 |
| h | 104 | 68 | 150 | 01101000 |
| i | 105 | 69 | 151 | 01101001 |
| j | 106 | 6A | 152 | 01101010 |
| k | 107 | 6B | 153 | 01101011 |
| l | 108 | 6C | 154 | 01101100 |
| m | 109 | 6D | 155 | 01101101 |
| n | 110 | 6E | 156 | 01101110 |
| o | 111 | 6F | 157 | 01101111 |
| p | 112 | 70 | 160 | 01110000 |
| q | 113 | 71 | 161 | 01110001 |
| r | 114 | 72 | 162 | 01110010 |
| s | 115 | 73 | 163 | 01110011 |
| t | 116 | 74 | 164 | 01110100 |
| u | 117 | 75 | 165 | 01110101 |
| v | 118 | 76 | 166 | 01110110 |
| w | 119 | 77 | 167 | 01110111 |
| x | 120 | 78 | 170 | 01111000 |
| y | 121 | 79 | 171 | 01111001 |
| z | 122 | 7A | 172 | 01111010 |
| { | 123 | 7B | 173 | 01111011 |
| | | 124 | 7C | 174 | 01111100 |
| } | 125 | 7D | 175 | 01111101 |
| ~ | 126 | 7E | 176 | 01111110 |

Q: How do I convert text to binary?
A: Turn each character into its UTF-8 bytes, then write each byte as eight binary digits. For Hi the bytes are 72 and 105, which are 01001000 and 01101001. The converter does this as you type and lets you choose the separator, 4-bit grouping and a 0b prefix.

Q: What is the binary code for the letter A?
A: Capital A is 01000001 (decimal 65, hexadecimal 41). Lower-case a is 01100001 (97, 61). Letters, digits and punctuation all have fixed codes; the table on this page lists the 95 printable ASCII characters.

Q: Why does é turn into two bytes but e into one?
A: UTF-8 uses one byte for the 128 ASCII characters and more bytes for the rest of Unicode: two for accented Latin letters, Greek, Cyrillic, Hebrew and Arabic, three for most other scripts including Sinhala and Tamil, and four for characters above U+FFFF such as most emoji. The first byte tells a reader how many bytes follow.

Q: Is this ASCII or Unicode?
A: Both, in the sense that matters. ASCII is the first 128 Unicode characters, and UTF-8 stores them as the same single bytes. Text that is plain English therefore gives the same bytes in ASCII and in UTF-8. The two differ only for characters outside ASCII.

Q: How do I convert binary back to text?
A: Choose Code to text, pick Binary and paste the bytes with a space between each group of eight digits. Groups of four digits (0100 1000) are also understood and are joined in pairs. If a group has seven digits the tool shows you the padded version to use, for example 01000001 for 1000001.

Q: What does it mean when the bytes are not valid UTF-8?
A: Some byte patterns can never appear in UTF-8: a continuation byte with no lead byte, a lead byte whose follower is missing, or the overlong forms C0 and C1. A common cause is text saved in Latin-1, where é is the single byte E9. In UTF-8 E9 starts a three-byte character, so it fails. The tool reports the byte position and keeps the bytes as they are.

Q: Is my text uploaded anywhere?
A: No. The conversion runs in your browser with its built-in TextEncoder and TextDecoder, and nothing you type is sent to a server.

Sources: RFC 3629, UTF-8, a transformation format of ISO 10646 (checked 13 October 2026) (https://www.rfc-editor.org/rfc/rfc3629); RFC 20, ASCII format for network interchange (checked 13 October 2026) (https://www.rfc-editor.org/rfc/rfc20); WHATWG Encoding Standard: TextEncoder and TextDecoder (checked 13 October 2026) (https://encoding.spec.whatwg.org/#interface-textencoder); Wikipedia: ASCII, printable characters 32 to 126 (checked 13 October 2026) (https://en.wikipedia.org/wiki/ASCII)

Related tools:

- [Morse code translator](https://hirantha.me/tools/morse-code-translator.md): Translate text to Morse code and Morse back to text with the ITU international characters. Play it as sound and see the timing chart.
- [Caesar cipher and ROT13](https://hirantha.me/tools/caesar-cipher.md): Encode or decode a Caesar cipher with any shift from -25 to 25, use ROT13, or try all 25 shifts of an unknown message and see the likeliest marked.
- [Base64 encode & decode](https://hirantha.me/tools/base64.md): Convert text to Base64 and back, right in your browser.
- [Number base converter](https://hirantha.me/tools/number-base-converter.md): Convert whole numbers between binary, octal, decimal, hex and any base from 2 to 36 with exact BigInt maths, negatives, two's complement and step-by-step working.
- [Hash generator](https://hirantha.me/tools/hash-generator.md): Generate a SHA-1, SHA-256, SHA-384, or SHA-512 hash of text.
