Text to Binary Converter
Convert text to binary, hex, octal, and decimal representations. Also decode binary back to text instantly.
Every character you type is stored as a number inside the computer. This text to binary converter shows you that number in four common bases: binary (base 2), hexadecimal (base 16), octal (base 8), and decimal (base 10). It also decodes binary back to text. All processing runs in your browser - no data is sent to any server.
About Text to Binary Converter
How Text Becomes Binary
Each character has a numeric code point defined by ASCII (for the first 128 characters) or Unicode (for everything else). The code point is then expressed in binary - a sequence of 0s and 1s that the computer stores and processes. The process is simple: look up the character's code point, then convert that number to the target base.
| Character | ASCII Code | Binary (8-bit) | Hex | Octal |
|---|---|---|---|---|
| A | 65 | 01000001 | 41 | 101 |
| B | 66 | 01000010 | 42 | 102 |
| a | 97 | 01100001 | 61 | 141 |
| z | 122 | 01111010 | 7A | 172 |
| 0 | 48 | 00110000 | 30 | 60 |
| 9 | 57 | 00111001 | 39 | 71 |
| (space) | 32 | 00100000 | 20 | 40 |
| ! | 33 | 00100001 | 21 | 41 |
To convert a decimal code point to binary by hand, repeatedly divide by 2 and record the remainders from bottom to top. For example, 65 divided by 2 gives 32 remainder 1, then 32 / 2 = 16 remainder 0, 16 / 2 = 8 remainder 0, 8 / 2 = 4 remainder 0, 4 / 2 = 2 remainder 0, 2 / 2 = 1 remainder 0, 1 / 2 = 0 remainder 1. Reading the remainders bottom-to-top: 1000001. Pad to 8 bits: 01000001. That is the letter "A" in binary.
Worked Example: Converting "Hello"
| Step | Character | Code Point | Binary (8-bit) | Hex | Octal |
|---|---|---|---|---|---|
| 1 | H | 72 | 01001000 | 48 | 110 |
| 2 | e | 101 | 01100101 | 65 | 145 |
| 3 | l | 108 | 01101100 | 6C | 154 |
| 4 | l | 108 | 01101100 | 6C | 154 |
| 5 | o | 111 | 01101111 | 6F | 157 |
So "Hello" in binary (space-separated, 8-bit padded) is 01001000 01100101 01101100 01101100 01101111. The hex output is 48 65 6C 6C 6F, the octal output is 110 145 154 154 157, and the decimal output is 72 101 108 108 111. To decode, reverse the process: split the binary string into 8-bit chunks and convert each chunk back to its decimal code point, then look up the character.
What Are Binary, Hex, Octal, and Decimal?
These are all number systems (also called bases) that represent the same value in different ways. The base determines how many unique digits are available before you need to carry over to the next position.
| System | Base | Digits Used | Prefix in Code | Common Use |
|---|---|---|---|---|
| Binary | 2 | 0, 1 | 0b | Low-level computing, bitwise operations, digital circuits |
| Octal | 8 | 0-7 | 0o | Unix file permissions (chmod 755), older computing systems |
| Decimal | 10 | 0-9 | (none) | Everyday numbers, most human-readable output |
| Hexadecimal | 16 | 0-9, A-F | 0x | Web colours (#FF5733), memory addresses, MAC addresses |
Hex is popular in programming because each hex digit maps exactly to four binary digits (bits). Two hex digits represent one byte (8 bits), making hex a compact way to display binary data. For example, the binary byte 11111111 is FF in hex and 255 in decimal. Octal was common on older systems where word sizes were multiples of 3 bits, and it still appears in Unix file permissions - chmod 755 sets read/write/execute for the owner (7 = 111 in binary), read/execute for the group (5 = 101), and read/execute for others (5 = 101).
ASCII Table: Printable Characters
ASCII (American Standard Code for Information Interchange) was first published as a standard on June 17, 1963, by the American Standards Association. It defines 128 characters using 7-bit code points (0-127). Before ASCII, over sixty different encoding systems were in use - IBM alone used nine separate systems. The printable range is 32-126:
| Range | Characters | Description |
|---|---|---|
| 0-31 | Control characters | Non-printable: null, tab, newline, carriage return, etc. |
| 32 | (space) | The space character |
| 33-47 | ! " # $ % & ' ( ) * + , - . / | Punctuation and symbols |
| 48-57 | 0-9 | Digits |
| 58-64 | : ; < = > ? @ | More punctuation |
| 65-90 | A-Z | Uppercase letters |
| 91-96 | [ \ ] ^ _ ` | Brackets and symbols |
| 97-122 | a-z | Lowercase letters |
| 123-126 | { | } ~ | Braces and tilde |
| 127 | DEL | Delete control character |
The design of ASCII has some useful properties. Uppercase and lowercase letters differ by exactly one bit (bit 5): A is 01000001 and a is 01100001. Digits 0-9 start at code point 48 (00110000), so the binary representation of the digit itself sits in the lower four bits. These patterns were intentional and made early hardware implementations simpler. For a full lookup reference, the ASCII table tool lists all 128 characters with their code points in every base.
Character Encoding Beyond ASCII
ASCII only covers 128 characters - enough for English but not for other languages. Modern computing uses Unicode (with UTF-8 encoding) to handle the world's writing systems. As of Unicode 17.0, the standard defines 159,801 named characters covering 172 scripts (Unicode Consortium). UTF-8, designed by Ken Thompson and Rob Pike in 1992, is now used by 98.9% of all websites as of March 2026 (W3Techs).
| Encoding | Character Range | Bytes Per Character | Used By |
|---|---|---|---|
| ASCII | 128 characters (English + basic symbols) | 1 byte (7 bits) | Legacy systems, simple text |
| Latin-1 (ISO 8859-1) | 256 characters (Western European) | 1 byte (8 bits) | Older web pages, email |
| UTF-8 | 1,112,064 code points (all Unicode) | 1-4 bytes | The web (98.9% of websites), Linux, macOS |
| UTF-16 | 1,112,064 code points (all Unicode) | 2 or 4 bytes | JavaScript strings, Windows internals, Java |
| UTF-32 | 1,112,064 code points (all Unicode) | 4 bytes (fixed) | Internal processing where fixed width is needed |
UTF-8 is backward-compatible with ASCII: any valid ASCII text is also valid UTF-8. Characters beyond the ASCII range use multi-byte sequences. For example, the pound sign (£) is code point 194 163, needing 2 bytes in UTF-8. A Chinese character like 汉 (water) is code point 27700, needing 3 bytes. Emoji like the grinning face are code point 128512, needing 4 bytes. This tool converts based on JavaScript's internal representation, which uses UTF-16 code units. For standard ASCII characters (0-127), the result is identical across all encodings.
How Does Binary Decoding Work?
Decoding binary back to text reverses the encoding process. The decoder splits the input into 8-bit groups, converts each group from base 2 to a decimal number, then maps that number to its corresponding character. Non-binary characters (anything other than 0 and 1) are stripped out first, so spaces and line breaks in the input do not affect the result.
Decoding example: Given the binary string 01010100 01100101 01110011 01110100, split into 8-bit groups: 01010100, 01100101, 01110011, 01110100. Convert each to decimal: 84, 101, 115, 116. Look up in ASCII: T, e, s, t. The decoded text is "Test".
A common mistake when decoding is forgetting about padding. The binary string 1001000 1101001 (without leading zeros) represents the same characters as 01001000 01101001, but the decoder needs consistent 8-bit groups to split correctly. If you paste unpadded binary without spaces, the decoder may misalign the bit boundaries. The safest approach is to use space-separated, 8-bit padded binary.
Where Is Text-to-Binary Conversion Used?
Converting between text and binary is fundamental to how computers work, but there are several specific contexts where developers and students encounter it directly:
Computer science education: Understanding binary representation is one of the first topics in any CS course. Students learn how text, images, and audio all reduce to sequences of bits. Converting "Hello" to binary by hand is a standard exercise for understanding how encoding works at the hardware level.
Network protocols: Data sent over networks travels as binary. Protocol headers, packet structures, and flags are defined in terms of specific bit positions. Network engineers reading packet captures often switch between binary, hex, and decimal views to interpret different fields.
File formats and debugging: Hex editors display file contents in hexadecimal (and sometimes binary) rather than text, because many file bytes are not printable characters. Understanding the hex-to-character mapping is essential when inspecting file headers, magic bytes, or binary formats.
Permissions and flags: Unix file permissions use octal notation. A permission of 755 means the owner has read, write, and execute (7 = 111 in binary), while the group and others have read and execute (5 = 101). Bitwise flags in programming work the same way - each bit represents a boolean option, and combining flags uses binary OR operations.
Cryptography and hashing: Hash outputs and encryption keys are typically displayed in hex because it is more compact than binary. A SHA-256 hash, for example, is 256 bits long - that is 64 hex characters versus 256 binary digits. The hash generator produces these hex-encoded outputs from text input.
Formatting Options
| Option | Effect | Example ("Hi") |
|---|---|---|
| Space-separated | Adds a space between each character's value | 01001000 01101001 |
| Continuous | No separator between values | 0100100001101001 |
| 8-bit padding | Adds leading zeros to fill 8 bits | 01001000 (not 1001000) |
Space-separated output is easier to read and safer for round-trip decoding, since each byte boundary is visible. Continuous mode produces a denser string that matches how data is actually stored in memory - no separators, just a stream of bits. The 8-bit padding option ensures every character uses exactly 8 binary digits, which matters for alignment and for feeding the output into other tools that expect fixed-width bytes.
Common Mistakes When Working with Binary
Confusing bit count with byte count: One byte is 8 bits. The word "Hello" is 5 bytes (5 characters at 1 byte each in ASCII), which is 40 bits. When someone says a file is "1 kilobyte", that is 1,024 bytes or 8,192 bits.
Mixing up encoding and encryption: Binary encoding is not encryption. Converting text to binary does not hide the content in any meaningful way - anyone can convert it back. Encoding changes the representation; encryption changes the content so it cannot be read without a key.
Assuming all characters are 1 byte: In ASCII, every character is 1 byte. But in UTF-8, characters can be 1 to 4 bytes. The euro sign (€) is 3 bytes in UTF-8. If you count bytes instead of characters for a UTF-8 string, the numbers will not match for anything outside the ASCII range.
Forgetting endianness: When storing multi-byte numbers, the byte order matters. Little-endian systems (most modern PCs) store the least significant byte first; big-endian systems store the most significant byte first. Network protocols typically use big-endian (also called network byte order). For single-byte ASCII characters this does not matter, but it becomes important when dealing with UTF-16 or UTF-32 encoded text.
For hex-specific work with colour codes, the hex to decimal converter has a focused interface. For a different kind of encoding, the Base64 encoder/decoder converts between text and Base64 format. To see every character and its code point in one place, check the ASCII table reference.
Sources
Frequently Asked Questions
How does text-to-binary conversion work?
Each character in your text is converted to its numeric ASCII or Unicode code point, which is then expressed in base-2 (binary). For example, the letter 'A' has the code point 65, which is 01000001 in 8-bit binary. This tool performs the conversion for every character in your input.
What is the difference between binary, hex, octal, and decimal output?
They are all ways to represent the same numeric value in different number bases. Binary uses base 2 (digits 0-1), octal uses base 8 (0-7), decimal uses base 10 (0-9), and hexadecimal uses base 16 (0-9 plus A-F). Hex is common in web colors and programming; binary is fundamental to computing.
Can I convert binary back to text?
Yes. Switch to decode mode and paste a binary string - with or without spaces between bytes. The tool will convert each 8-bit group back to its corresponding character, reconstructing the original text.
Does this tool support Unicode characters?
The tool converts characters based on their Unicode code points. Standard ASCII characters (code points 0-127) produce clean 8-bit binary values. Characters outside the basic ASCII range will use their full code point value, which may require more than 8 bits.
Related Tools
Link to this tool
Copy this HTML to link to this tool from your website or blog.
<a href="https://toolboxkit.io/tools/text-to-binary/" title="Text to Binary Converter - Free Online Tool">Try Text to Binary Converter on ToolboxKit.io</a>