Convert Text to Binary and Binary to Text Online Tool
Converts an ASCII, Unicode or UTF8 string to its binary representation and Binary to Text translator
Paste or upload your text or binary data to respective textbox and click button to convert Text to Binary or Binary to Text
Text to Binary and Binary to Text: The Complete Binary Translator Guide
Discover how every letter you type becomes a string of 1s and 0s. Learn to convert text to binary and binary back to text by hand, in JavaScript, and instantly with our free online translator.
01Introduction
Every word you've ever typed into a computer — this sentence included — exists at its most fundamental level as a long string of 0s and 1s. Computers don't understand letters, punctuation, or emoji directly; they only understand binary electrical states. Text to binary conversion (and its reverse, binary to text conversion) is the bridge that lets human-readable language and machine-readable binary data talk to each other.
You've likely seen this in action without necessarily recognizing it: a novelty t-shirt printed with a string of 1s and 0s that secretly spells out a message, a puzzle or escape room clue encoded in binary, or a programming exercise asking you to convert a name into its binary representation. Behind all of these is the same underlying system — a character encoding standard called ASCII (and its modern successor, Unicode) that assigns every letter, number, and symbol a specific numeric code, which is then represented in binary.
This guide covers everything you need to understand and perform text-binary conversion: what "string binary" actually means, how encoding and decoding work, step-by-step manual conversion methods, a working JavaScript code example, real-world applications, handy ASCII reference tables, and how to use our free Text to Binary and Binary to Text Conversion Tool — also known as a binary translator — to convert instantly whenever you need it.
Fig 1.1 — "Hi" encoded to binary, then decoded back to text
Whether you're a student encountering character encoding for the first time, a developer debugging a text-processing bug, or simply someone who wants to decode a binary message on a t-shirt or in a puzzle, this guide is written to take you from the underlying theory all the way through to fast, confident, real-world application.
02What is String Binary?
String binary refers to the binary representation of a text string — a sequence of characters like a word, sentence, or password — where each individual character has been converted into its corresponding binary code. Rather than one number for the whole string, string binary is really a sequence of individual character codes, each typically represented using a fixed number of bits (commonly 8 bits, or one byte, per character). Understanding this distinction — one binary group per character, rather than one giant number for the whole string — is the single most important mental model for everything that follows in this guide.
The key to understanding string binary is recognizing that computers don't directly "know" what a letter like "A" looks like. Instead, a standardized lookup system called a character encoding assigns every character a specific numeric value. The most foundational and widely known of these systems is ASCII (American Standard Code for Information Interchange), which assigns a unique number from 0 to 127 to each English letter, digit, punctuation mark, and common control character. Once a character has an assigned number, that number can be converted into binary using the exact same decimal-to-binary technique used for any other number.
Why 8 Bits Per Character?
Standard ASCII only technically needs 7 bits to represent its 128 possible values (2⁷ = 128), but in practice, text is almost universally represented using a full 8-bit byte per character, with the extra bit historically used for error-checking (parity) or, in extended ASCII systems, to support an additional 128 characters for accented letters, symbols, and box-drawing characters. This 8-bits-per-character convention is what you'll see throughout this guide and in virtually every text-to-binary converter you'll encounter online.
Fig 2.1 — Each character maps to a decimal ASCII code, then to an 8-bit binary value
A Brief History of ASCII
ASCII was developed in the early 1960s by a committee working under the American National Standards Institute (ANSI), with the first version published in 1963 and revised through the decade. The goal was straightforward but ambitious for its time: create a single, standardized numeric code for text characters so that different computer systems and teletype machines from different manufacturers could reliably exchange text data without garbling it. Before ASCII, competing manufacturers often used incompatible character encoding schemes, which made exchanging text between different machines a genuine technical headache.
ASCII's elegant design choices — placing digits, uppercase letters, and lowercase letters in tidy, consecutive numeric blocks — were intentional, making certain programming operations (like case conversion or checking whether a character is a digit) mathematically simple. This clean structure is a big part of why ASCII remained the dominant text encoding standard for decades, and why its first 128 code points were later preserved unchanged as the foundation of Unicode, ensuring that ASCII text would never become obsolete even as computing moved toward supporting the full range of world languages.
03Text to Binary (Encoding)
Encoding is the process of converting human-readable text into binary. Every character in a string is looked up in a character encoding table (like ASCII), converted to its decimal code, and then that decimal code is converted to an 8-bit binary value. The individual binary groups are typically separated by a space for readability, though the underlying data is really just one continuous stream of bits.
Let's walk through encoding the word "Hi" into binary:
Notice that capitalization matters — uppercase and lowercase letters have entirely different ASCII codes (uppercase 'H' is 72, while lowercase 'h' is 104), which means the resulting binary is different too. This is an important detail to keep in mind, since a text-to-binary conversion is case-sensitive by nature, just like the underlying character encoding it relies on.
Spaces, punctuation, and numbers all encode the same way — they simply have their own ASCII codes. A space character, for example, has decimal code 32, which converts to binary 00100000. This means when you encode a full sentence, the spaces between words become their own 8-bit binary groups in the output, just like any other character.
04Binary to Text (Decoding)
Decoding is the reverse process: taking a string of binary digits, splitting it into 8-bit groups, converting each group back into its decimal value, and then looking up which character that decimal value represents in the ASCII table. Decoding only works correctly if the binary was encoded using the same character encoding standard in the first place — attempting to decode ASCII-encoded binary using a different table would produce garbled, meaningless output.
Let's decode the binary string 01001000 01101001 back into text:
This is exactly the reverse of the encoding process shown above — a helpful way to think about it is that encoding and decoding are mirror images of each other, using the same ASCII lookup table in opposite directions. If you encode a message and then immediately decode the result, you should always land back on your original text exactly, character for character.
05How to Convert a String to Binary Manually
Converting a full string to binary by hand is simply the single-character encoding process from the previous section, repeated for every character in order. Here's the complete step-by-step method:
- Write out each character of your string individually, including spaces and punctuation, in their original order.
- Look up each character's decimal ASCII code using a reference table (see the full table later in this guide).
- Convert each decimal code to 8-bit binary using the repeated-division-by-2 method, padding with leading zeros to always reach exactly 8 digits.
- Combine the 8-bit binary groups in order, typically separated by a space for readability.
Worked Example: Convert "Cat" to Binary
If you need a refresher on the repeated-division-by-2 method itself (dividing by 2, recording remainders, and reading them from bottom to top), it's the exact same decimal-to-binary technique used for converting any whole number — the only extra step here is looking up each character's ASCII code first, before applying that familiar conversion process.
Fig 5.1 — Encoding each letter of "Cat" independently into 8-bit binary
06How to Convert Binary to a String Manually
Converting binary back into readable text follows the same logic in reverse. Here's the complete step-by-step method:
- Split the binary string into groups of 8 digits each, working from left to right (each group represents one character).
- Convert each 8-bit group to its decimal value using the positional-value method (multiplying each bit by its corresponding power of 2 and summing).
- Look up each decimal value in the ASCII table to find its corresponding character.
- Combine the characters in order to reconstruct the original text string.
Worked Example: Decode 01000011 01100001 01110100
As expected, decoding this binary string brings us right back to "Cat" — the same word we encoded in the previous section. This kind of round-trip check (encode, then immediately decode your own result) is one of the best ways to build confidence in your manual conversion skills before attempting longer messages.
07How to Convert Text to Binary in JavaScript
While manual conversion is great for building understanding, real applications almost always handle text-binary conversion in code. JavaScript makes this remarkably simple using two built-in string and character methods: charCodeAt() and toString(2).
Text to Binary in JavaScript
The charCodeAt() method returns a character's decimal Unicode/ASCII value, and calling .toString(2) on a number converts it to a binary string. Combining these across every character in a string gives you a full text-to-binary converter in just a few lines:
The .padStart(8, '0') call is essential — without it, a character like a space (decimal 32, binary 100000) would only produce 6 binary digits instead of the expected 8, breaking the fixed-width grouping that binary-to-text decoding depends on.
Binary to Text in JavaScript
Going the other direction uses parseInt() to convert each 8-bit binary group back into a decimal number, and String.fromCharCode() to convert that number into its corresponding character:
The second argument to parseInt() — the number 2 — tells JavaScript to interpret the string as base-2 (binary) rather than base-10 (decimal), which is the key detail that makes this function work correctly.
Fig 7.1 — The two core JavaScript functions for text-binary conversion, side by side
These same core methods — character-code lookup paired with base conversion — appear in nearly every programming language, just with different function names: Python uses ord() and chr(), Java uses (int) char casting alongside Integer.toBinaryString(), and so on. Once you understand the JavaScript version, adapting the same logic to another language is mostly a matter of learning that language's equivalent function names.
The Same Logic in Python
For comparison, here's the equivalent text-to-binary and binary-to-text logic written in Python, using its built-in ord() (character to decimal) and chr() (decimal to character) functions:
Python's format(ord(char), '08b') combines the character-to-decimal lookup and the 8-bit binary padding into a single, compact expression — a good illustration of how the underlying concept stays identical across languages even when the specific syntax differs.
08List of String Binary Applications and Uses
Text-binary conversion isn't just a novelty or classroom exercise — it underlies a surprising amount of real-world technology. Here are some of the most important places it shows up in practice, from everyday software to specialized technical fields.
Digital Data Storage & Transmission
Every piece of text stored on a hard drive, sent over a network, or transmitted through fiber-optic cable is ultimately represented as binary. Understanding text-binary conversion helps explain how something as abstract as an email or a text message physically travels as electrical or optical signals.
Programming & Software Development
Developers frequently work with character codes directly when parsing files, validating input, working with low-level string buffers, or debugging encoding-related bugs (such as a file that displays as garbled text because it was decoded using the wrong character encoding).
Cryptography & Basic Ciphers
Simple substitution and XOR-based ciphers often operate directly on the binary representation of text, flipping or shifting individual bits to obscure a message. While these particular ciphers are far too simple for real security use, they're commonly used to teach the fundamentals of how more sophisticated cryptographic algorithms manipulate data at the bit level.
Steganography & Puzzle Design
Binary is a popular medium for hiding messages in plain sight — puzzle designers, escape rooms, and recreational cryptography enthusiasts often encode secret messages as strings of 1s and 0s, since it looks intimidating to a casual observer but is straightforward to decode once you know the ASCII table.
Digital Forensics & Data Recovery
Investigators examining raw disk images or memory dumps often need to manually identify and decode ASCII text embedded within binary data, a process sometimes called "string extraction," which relies directly on recognizing valid 8-bit character patterns within a larger stream of binary.
Educational & Computer Science Curriculum
Text-to-binary conversion is one of the most common introductory exercises in computer science courses, since it concretely demonstrates how abstract binary numbers connect to something immediately familiar and meaningful — actual written language.
Retro Computing & Binary Art
Hobbyists working with vintage computers, teletype machines, or punch-card systems often encounter raw binary or its close relatives (like Baudot code) directly, since these older systems predate modern high-level text rendering. Understanding character-level binary encoding is genuinely useful for anyone restoring or emulating retro computing hardware, where text output is generated one binary-encoded character at a time.
Accessibility & Assistive Technology
Refreshable Braille displays and certain assistive communication devices translate digital text into other encoded forms behind the scenes, and understanding how character-based encoding works at a fundamental level helps developers building or troubleshooting these accessibility tools reason about how text data flows from a screen into an alternative output format.
Fig 8.1 — Text-binary conversion in real-world and educational contexts
09Common ASCII Examples
Seeing a handful of common characters and their ASCII codes side by side helps build the kind of pattern recognition that makes manual conversion faster. Here are some frequently referenced examples.
| Character | Decimal | Binary | Description |
|---|---|---|---|
| Space | 32 | 00100000 | Word separator |
| ! | 33 | 00100001 | Exclamation mark |
| 0 | 48 | 00110000 | Digit zero |
| 9 | 57 | 00111001 | Digit nine |
| A | 65 | 01000001 | Uppercase A (first letter) |
| Z | 90 | 01011010 | Uppercase Z (last letter) |
| a | 97 | 01100001 | Lowercase a |
| z | 122 | 01111010 | Lowercase z |
| @ | 64 | 01000000 | At symbol |
| . | 46 | 00101110 | Period / full stop |
Notice the elegant pattern: uppercase letters run from decimal 65 (A) to 90 (Z), and lowercase letters run from 97 (a) to 122 (z) — a consistent 32-value offset between the two cases. This predictable structure is exactly why simple ASCII-based case-conversion tricks work in programming: adding or subtracting 32 from a letter's ASCII code toggles it between uppercase and lowercase.
10ASCII Text to Hex, Binary Conversion Table
Below is a reference table covering the uppercase alphabet along with its decimal, hexadecimal, and binary ASCII values — one of the most frequently needed lookups when working with text-binary conversion by hand. Keeping this table close at hand saves significant time compared to searching for a full ASCII chart every time you need to look up a single character.
| Character | Decimal | Hex | Binary |
|---|---|---|---|
| A | 65 | 41 | 01000001 |
| B | 66 | 42 | 01000010 |
| C | 67 | 43 | 01000011 |
| D | 68 | 44 | 01000100 |
| E | 69 | 45 | 01000101 |
| F | 70 | 46 | 01000110 |
| G | 71 | 47 | 01000111 |
| H | 72 | 48 | 01001000 |
| I | 73 | 49 | 01001001 |
| J | 74 | 4A | 01001010 |
| K | 75 | 4B | 01001011 |
| L | 76 | 4C | 01001100 |
| M | 77 | 4D | 01001101 |
| N | 78 | 4E | 01001110 |
| O | 79 | 4F | 01001111 |
| P | 80 | 50 | 01010000 |
| Q | 81 | 51 | 01010001 |
| R | 82 | 52 | 01010010 |
| S | 83 | 53 | 01010011 |
| T | 84 | 54 | 01010100 |
| U | 85 | 55 | 01010101 |
| V | 86 | 56 | 01010110 |
| W | 87 | 57 | 01010111 |
| X | 88 | 58 | 01011000 |
| Y | 89 | 59 | 01011001 |
| Z | 90 | 5A | 01011010 |
For lowercase letters, digits, and punctuation, the same table structure applies — you can find a character's decimal code, convert it to hex using the decimal-to-hex conversion method, or convert it straight to binary using repeated division by 2. Bookmarking or printing a full ASCII table (widely available as a single-page reference) alongside this guide is one of the most efficient ways to speed up manual text-binary conversion work.
11ASCII vs Unicode: What's the Difference?
ASCII is a 7-bit (or 8-bit extended) character encoding standard developed in the 1960s, capable of representing only 128 (or 256, in extended form) distinct characters — enough for the English alphabet, digits, and basic punctuation, but nowhere near enough for the full range of world languages, symbols, and emoji used online today.
Unicode was developed to solve this limitation by assigning a unique numeric code point to essentially every character used in every written language on Earth, along with symbols, emoji, and more — well over 140,000 characters as of recent versions. Critically, Unicode was designed to be backward-compatible with ASCII: the first 128 Unicode code points are identical to standard ASCII, meaning any valid ASCII text is also valid Unicode text with no conversion needed.
UTF-8: The Bridge Between ASCII and Unicode
The most widely used Unicode encoding on the modern web is called UTF-8, which cleverly uses a variable number of bytes per character: standard English letters and digits still use just 1 byte (identical to ASCII), while characters from other writing systems, symbols, or emoji may use 2, 3, or 4 bytes depending on how far into the Unicode range they fall. This is precisely why an emoji like 🙂 takes up noticeably more storage space than a plain letter like "a" — it requires more bytes to represent within the UTF-8 encoding scheme.
12Common Mistakes to Avoid
- Forgetting to pad to 8 bits. A character with a small ASCII code, like a space (32) or digit (48–57), converts to fewer than 8 binary digits using simple division — always pad with leading zeros to reach exactly 8 bits per character.
- Mixing up uppercase and lowercase codes. 'A' (65) and 'a' (97) are completely different values — always double-check case before looking up a character's ASCII code.
- Splitting binary into the wrong group size. Standard ASCII-encoded binary should always be split into groups of exactly 8 digits during decoding — splitting into any other size produces meaningless results.
- Assuming all binary text uses ASCII. Some binary-encoded text uses Unicode (typically UTF-8), where character byte-lengths vary — always confirm which encoding standard was used before decoding unfamiliar binary data.
- Losing track of spaces between binary groups. Spaces separating 8-bit groups exist purely for human readability — the underlying data is one continuous bit stream, and encoding/decoding tools may format this differently depending on their settings.
- Skipping verification. Always decode your own encoded output (or vice versa) to confirm you land back on the original text — this simple round-trip check catches nearly every common manual conversion mistake.
- Forgetting that punctuation and numbers also need encoding. Beginners sometimes only account for letters when encoding a sentence, forgetting that spaces, commas, periods, and digits all have their own distinct ASCII codes and must be encoded just like any letter.
13Key Features of Our Text to Binary and Binary to Text Conversion Online Tool
Manual conversion is a great way to understand the mechanics, but when you're working with longer messages, our Text to Binary and Binary to Text Conversion Tool (also known as a binary translator) delivers instant, accurate results. Here's what makes it a reliable everyday utility for students, developers, and puzzle enthusiasts alike.
Instant, Real-Time Conversion
Type text or paste binary and see the converted result update immediately — no page reloads, no waiting.
Two-Way Translation
Convert text to binary and binary back to text in the same tool, without needing to switch between separate converters.
Handles Full Sentences
Encode and decode entire sentences and paragraphs, not just single words, with spaces and punctuation preserved correctly.
Free, Private & No Sign-Up
No account, subscription, or installation required. All conversions run directly in your browser with no data stored on our servers.
Mobile-Friendly Design
Fully responsive layout that works smoothly on desktops, tablets, and smartphones, so you can convert text wherever you're working.
One-Click Copy
Copy any converted output straight to your clipboard, ready to paste into a message, puzzle, or piece of code.
Unlike attempting the same conversion by hand — which requires flipping through an ASCII table character by character — this tool handles entire messages instantly, correctly manages spaces and punctuation, and eliminates the risk of a single mistyped bit throwing off an otherwise perfect message.
Whether you're building an escape-room puzzle, checking a homework assignment, decoding a novelty binary t-shirt, or simply satisfying your curiosity about how a favorite phrase looks in binary, having a dedicated converter on hand removes all the tedious lookup work and lets you focus on the message itself.
14How to Use the Text to Binary and Binary to Text Conversion Online Tool
Getting a conversion from our Text to Binary and Binary to Text Conversion Tool takes just a few seconds. Here's the full walkthrough:
- Open the tool by visiting onlinewebtoolkit.com/text-binary-converter in any browser — desktop or mobile.
- Choose your conversion direction — text to binary, or binary to text — depending on what you're starting with.
- Enter your text or binary into the input field. For binary input, use only 0s and 1s, with spaces separating each 8-bit group.
- View the result instantly as it updates automatically while you type — no separate "Convert" button needed for basic use.
- Copy the output using the copy icon, ready to paste directly into your message, project, or notes.
Tips for Getting the Most Out of the Tool
A few small habits make the converter even more useful. If you're designing a puzzle or escape room clue, encode your message first, then decode your own output to confirm it reads back correctly before finalizing the puzzle. If you're learning to program, try encoding a short phrase manually first, then check your work against the tool's output — this is one of the fastest ways to build genuine fluency with ASCII values rather than just memorizing a formula. And if you're working with a mix of uppercase and lowercase text, pay close attention to case in your input, since the tool (correctly) treats 'A' and 'a' as entirely different characters with different binary values, and getting this detail wrong is one of the most common sources of confusion for beginners.
Try the Binary Translator Now
Skip the manual lookup and get accurate text-to-binary and binary-to-text conversions in seconds.
Open the Free Tool →15Frequently Asked Questions
Look up each character's decimal ASCII code, convert that decimal number to binary using repeated division by 2, and pad the result to exactly 8 digits. Repeat for every character and combine the results in order.
Standard character encoding represents each character using one byte, which is exactly 8 bits. Grouping binary into 8-digit chunks ensures each group corresponds to exactly one character during decoding.
Yes. Uppercase and lowercase letters have entirely different ASCII codes (for example, 'A' is 65 while 'a' is 97), so their binary representations are different, even though they represent the "same" letter visually.
ASCII covers only 128 basic characters using a single byte each, while Unicode (commonly encoded as UTF-8) supports well over 140,000 characters using a variable number of bytes, allowing it to represent virtually any written language or symbol.
Use charCodeAt() to get each character's decimal code, then call toString(2) to convert it to binary, padding to 8 digits with padStart(8, '0'). The reverse uses parseInt(binary, 2) paired with String.fromCharCode().
Not using standard 8-bit ASCII logic. Emoji fall outside the ASCII range and require Unicode (typically UTF-8) encoding, which uses a variable number of bytes per character rather than a fixed 8 bits.
Not exactly. Text-encoded binary represents characters using ASCII or Unicode, while a processor's actual machine language uses binary to represent instructions and operations, which is a related but distinct use of binary data.
Spaces between 8-bit groups exist purely to help human readers identify character boundaries. The underlying binary data itself is really one continuous stream of bits, with spacing added only for readability.
ASCII was developed by a standards committee in the United States in the early 1960s, with the first version published in 1963, in order to give different computer manufacturers a shared, compatible way to represent text.
Yes. Python's built-in ord() function returns a character's decimal code, and format(code, '08b') converts that number into an 8-bit binary string, mirroring the same logic used in JavaScript's charCodeAt() and toString(2).


Please Wait ...