Binary Code:
Enter text above
Text to Binary Conversion Process
This calculator converts text characters into binary code (base-2 representation) using different character encoding standards. Each character is transformed into its numerical value according to the selected encoding (ASCII, UTF-8, or UTF-16), then converted to binary format. The output can be formatted with various separators for improved readability.
Conversion Formula
Decimal to Binary Conversion:
Binary = dndn-1...d1d0
Where each digit di = (Decimal ÷ 2i) mod 2
Character to Binary Process:
Step 1: Character → ASCII/UTF code point (decimal value)
Step 2: Decimal value → Binary representation
Step 3: Pad to 8 bits (ASCII/UTF-8) or 16 bits (UTF-16)
Example: Character 'A' (ASCII 65)
65 = 64 + 1 = 26 + 20
Binary: 01000001
Position: [27][26][25][24][23][22][21][20]
Values: [0][1][0][0][0][0][0][1]
Practical Examples
Example 1: Single character (ASCII, space separator)
Input: "H"
Output: 01001000
Example 2: Simple word (ASCII, space separator)
Input: "Hi"
Output: 01001000 01101001
Example 3: Word without separator (ASCII, no separator)
Input: "Hello"
Output: 0100100001100101011011000110110001101111
Example 4: Comma separator (ASCII, comma separator)
Input: "OK"
Output: 01001111,01001011
Example 5: Numbers to binary (ASCII, space separator)
Input: "2025"
Output: 00110010 00110000 00110010 00110101
Example 6: Special characters (ASCII, space separator)
Input: "A+B"
Output: 01000001 00101011 01000010
Example 7: Punctuation marks (ASCII, space separator)
Input: "Hello!"
Output: 01001000 01100101 01101100 01101100 01101111 00100001
Example 8: UTF-8 encoding with symbol
Input: "©" (UTF-8 encoding)
Output: 11000010 10101001
Example 9: UTF-16 encoding
Input: "AB" (UTF-16 encoding)
Output: 0000000001000001 0000000001000010
Example 10: Mixed case letters (ASCII, comma separator)
Input: "aB"
Output: 01100001,01000010
Encoding Details: ASCII encoding uses 8 bits (1 byte) per character and supports characters 0-127. UTF-8 is variable-length encoding using 1-4 bytes per character, backward compatible with ASCII. UTF-16 uses 16 bits (2 bytes) per character for the Basic Multilingual Plane. Choose the separator option to format the binary output for better readability.