How to Convert Text to Binary (Step-by-Step)

By Text to Binary Editorial Team
Try the Binary Converter
How to Convert Text to Binary (Step-by-Step) — illustration

Why Convert Text to Binary?

Converting text to binary means choosing a character encoding, producing bytes, and then writing each byte in base 2. Understanding those three layers prevents a common mistake: assuming every visible character is one byte. Whether you're a student learning the basics or a developer debugging encoding issues, this guide shows both text → binary and binary → text with examples that can be reproduced in the browser converter.

Technical review — 17 July 2026. The ASCII and UTF-8 descriptions were checked against IETF RFC 20, IETF RFC 3629, Unicode 17, and the WHATWG Encoding Standard. Published byte examples are also asserted in automated tests.

Step 1: Understand ASCII Character Codes

The first step is identifying the character value and encoding. ASCII (American Standard Code for Information Interchange) is a 7-bit code with values 0 through 127. Uppercase letters A–Z are 65–90, lowercase a–z are 97–122, digits 0–9 are 48–57, and space is 32. The word "Hi" therefore uses ASCII values 72 and 105.

Unicode separates the character's code point from its byte encoding. UTF-8 preserves every ASCII value as the same single byte and encodes other Unicode scalar values in sequences of 2, 3, or 4 bytes. UTF-8 does not "extend a byte"; it defines a variable-width mapping from scalar values to byte sequences.

Step 2: Convert Decimal to Binary

Once you have the ASCII decimal value for a character, you need to convert that number to binary. The method is simple: repeatedly divide by 2 and record the remainders. Let's convert "H" (ASCII 72) to binary. Divide 72 by 2 = 36, remainder 0. Divide 36 by 2 = 18, remainder 0. Divide 18 by 2 = 9, remainder 0. Divide 9 by 2 = 4, remainder 1. Divide 4 by 2 = 2, remainder 0. Divide 2 by 2 = 1, remainder 0. Divide 1 by 2 = 0, remainder 1. Now read the remainders from bottom to top: 1001000. Since we typically use 8-bit bytes, pad with a leading zero: 01001000. That's "H" in binary! For "i" (ASCII 105), the same process yields 01101001. So "Hi" in binary is 01001000 01101001.

Step 3: Apply the Process to Complete Words

To convert an entire word or sentence, simply repeat the process for each character. Let's convert the word "Hello" to binary. "H" = 72 = 01001000. "e" = 101 = 01100101. "l" = 108 = 01101100. "l" = 108 = 01101100. "o" = 111 = 01101111. Putting it all together, "Hello" in binary is: 01001000 01100101 01101100 01101100 01101111. Notice that each character becomes exactly 8 bits (one byte) in standard ASCII encoding. Spaces between bytes aren't required by computers but make the binary much more readable for humans. When computers process this data, they read the continuous stream of bits and split them into bytes based on the encoding rules. This is exactly what our binary converter tool does automatically — but understanding the manual process helps you truly grasp what's happening.

Step 4: Handle Special Characters and Spaces

Don't forget that spaces, punctuation, and special characters all have their own binary representations. The space character (ASCII 32) converts to 00100000. An exclamation mark (ASCII 33) is 00100001. The period (ASCII 46) is 00101110. A newline character (ASCII 10) is 00001010. So the phrase "Hi!" would be: 01001000 01101001 00100001. Numbers within text are also treated as characters, not numeric values. The digit "5" in text isn't stored as binary 101 — it's stored as ASCII 53, which is 00110101. This distinction between the character "5" and the number 5 is crucial in programming and text encoding. When debugging encoding issues, being able to identify these special character codes in their binary form is extremely helpful.

UTF-8 Examples Beyond ASCII

For non-ASCII text, convert the code point to its complete UTF-8 byte sequence before rendering the bytes as binary:

Text Unicode code point UTF-8 hex bytes Binary bytes
A U+0041 41 01000001
é U+00E9 C3 A9 11000011 10101001
U+20AC E2 82 AC 11100010 10000010 10101100
😀 U+1F600 F0 9F 98 80 11110000 10011111 10011000 10000000

This is why "character", "code point", and "byte" are not interchangeable. A user-perceived symbol can even consist of multiple Unicode code points, each of which is encoded separately.

The Quick Method: Using Powers of 2

There's a faster way to convert decimal to binary if you memorize the powers of 2. For an 8-bit byte, the place values from left to right are: 128, 64, 32, 16, 8, 4, 2, 1. To convert a decimal number, start from the largest power and work down. Can you subtract 128? If yes, write 1 and subtract it; if no, write 0. Repeat for each power. For example, let's convert 101 (the letter "e"): 101 >= 128? No -> 0. 101 >= 64? Yes -> 1, 101 - 64 = 37. 37 >= 32? Yes -> 1, 37 - 32 = 5. 5 >= 16? No -> 0. 5 >= 8? No -> 0. 5 >= 4? Yes -> 1, 5 - 4 = 1. 1 >= 2? No -> 0. 1 >= 1? Yes -> 1. Result: 01100101. This method is faster once you get comfortable with powers of 2.

Converting Binary Back to Text

The reverse process — binary to text — starts by splitting the stream into complete 8-bit bytes. For ASCII-range bytes, converting each byte to its ASCII value is enough: 01010100 01100101 01110011 01110100 becomes 84, 101, 115, 116, or "Test".

For non-ASCII text, the decoder must interpret the complete byte sequence as UTF-8. For example, 11100010 10000010 10101100 is the three-byte sequence E2 82 AC, which decodes to . A lone first byte such as 11100010 is not a complete character, and 11111111 is never a valid UTF-8 byte. The converter rejects those malformed sequences rather than silently presenting replacement text.

Primary Sources and Verification

The converter uses the browser's standards-defined TextEncoder and a fatal UTF-8 TextDecoder for round-trip verification. Automated tests cover the A, é, , and 😀 byte sequences plus malformed input.

Use Our Free Binary Converter Tool

While understanding the manual conversion process is educational, you don't need to do it by hand every time. The free text-to-binary and binary-to-text converter displays UTF-8 binary output, hexadecimal, octal, decimal, and printable ASCII-byte views in real time. Conversion runs in your browser, and malformed binary or UTF-8 is called out instead of being silently wrapped or replaced.

Convert Binary Instantly

Convert between binary, text, decimal, hex, and octal with our free online tool.

Open Binary Converter