Bridging human text and machine language
Text and binary represent the same information in two different forms. A human reads the letter “A”; a computer processes the binary pattern 01000001 (65 in decimal). Understanding this translation is foundational to computer science: how text is stored in memory, transmitted over networks, and processed by CPUs. Modern systems abstract away the binary details, but knowing how to convert between text and binary is useful for debugging, learning how encodings work, and understanding why certain constraints exist (why some characters are “special”, why Unicode exists, why file sizes matter).
This tool handles ASCII (American Standard Code for Information Exchange), the 7-bit encoding that predates Unicode. ASCII defines 128 characters (0–127): uppercase and lowercase letters, digits, punctuation, and control codes. Each character maps to a decimal number, which converts to an 8-bit binary representation (padded with a leading zero for clarity). Modern systems use UTF-8, a variable-width encoding that's backward-compatible with ASCII for those 128 characters but extends to millions more for emoji and international scripts.
How text encoding works
The journey from text to binary is direct: each character has a code point (a number). ASCII assigns A=65, B=66, space=32, etc. The code point converts to binary by repeated division by 2 (collecting remainders). For ASCII, 8 bits (1 byte) per character suffice. The letter “H” has code 72, which is 01001000 in binary: 0×128 + 1×64 + 0×32 + 0×16 + 1×8 + 0×4 + 0×2 + 0×1 = 64 + 8 = 72.
Spaces matter. Binary "01001000 01100101 01101100 01101100 01101111" (five 8-bit chunks) decodes to "Hello" because each chunk is treated independently. Without spacing, "0100100001100101" is ambiguous—is it two 8-bit chars, or could it be parsed differently? Spaces in binary notation are conventions for readability; the computer sees continuous bits.
UTF-8 complicates this. ASCII characters (0–127) stay as single bytes. Extended characters (accents, emoji, etc.) use 2–4 bytes, where the first byte signals length. This is why a text file with emoji takes more storage than one with ASCII only. This tool sticks to ASCII for simplicity, but understanding that text = numbers = binary is the key insight.
ASCII and character encoding history
- ASCII (1963). 7-bit standard for 128 characters. Designed for telegraphs and early computers. Still the foundation of modern text.
- Extended ASCII (1980s). Added 128 characters (codes 128–255) for accents and box-drawing. Not universal—different code pages existed.
- Unicode (1991). Unified encoding for all world scripts. Millions of code points. UTF-8 is the most popular encoding, backward-compatible with ASCII.
- UTF-8 (1992). Variable-length encoding: ASCII chars stay 1 byte, others use 2–4. The de facto standard for web and modern systems.
Common conversions and examples
- “Hi” in binary: H=72=01001000, i=105=01101001, so "Hi" = "01001000 01101001"
- Binary 01000001 in text:01000001 = 65 decimal = “A”
- Special characters: Space (32), newline (10), tab (9) are also characters with binary representations.
- Why 8 bits?: A byte is the standard memory unit. 8 bits hold 256 values (0–255), enough for ASCII plus extended ASCII.
Frequently asked questions
Why do we use 8 bits if ASCII only needs 7?
Historically, the 8th bit was used for parity checking (error detection). Modern systems don't need it, but 8-bit bytes became the standard memory unit, so ASCII extended to fill a full byte. It's now just convention and convenience.
Can you convert emoji to binary?
Not with this ASCII-only tool. Emoji are Unicode characters outside ASCII's 0–127 range. In UTF-8, emoji require 3–4 bytes each. You'd need a UTF-8 converter to handle them.
Why are control codes like newline (10) in the ASCII table?
ASCII includes 32 control codes (0–31) from its teletype heritage. Newline signals a line break, tab indents text, null terminates strings in C, etc. Modern systems rarely use most of them, but they're still defined and occasionally matter.
Is my text converted and stored anywhere?
No. All conversion happens in your browser. Your text is never sent to a server, making this tool safe for any content.