Text to Binary Converter

Text Input

Binary Input

Binary Output

Text Output

Note: Each character is converted to 8-bit binary (ASCII/UTF-8)

How each character becomes 8 digits

The converter calls JavaScript's charCodeAt() to get each character's numeric code, then converts that number to binary and pads it to 8 digits with leading zeros. For standard ASCII text (letters, digits, common punctuation), that 8-bit code matches the character's UTF-8 byte value exactly.

Worked example

Type "Hi" into the Text Input box. The letter H has character code 72; in binary, 72 = 64 + 8 = 01001000. The letter i has character code 105; in binary, 105 = 64 + 32 + 8 + 1 = 01101001. The tool joins these with a space, producing 01001000 01101001 as the binary output. Feeding that same string into the Binary Input box and clicking Binary → Text reverses the process: parseInt("01001000", 2) = 72 = "H", and parseInt("01101001", 2) = 105 = "i", reconstructing "Hi".

Why 8 bits per character

8 bits (1 byte) can represent 256 distinct values (2⁸), which comfortably covers the 128-value ASCII character set with room to spare. Characters outside basic ASCII (accented letters, symbols, emoji) may use multiple bytes under UTF-8 encoding, and charCodeAt() reads UTF-16 code units rather than full Unicode code points, so unusual characters outside the Basic Multilingual Plane won't round-trip perfectly through this specific 8-bit-per-unit scheme.

Constraints

The Binary → Text direction accepts either space-separated 8-bit groups or one continuous string that it slices into 8-character chunks; any non-0/1 characters are stripped before parsing, and a chunk that isn't exactly matched to a valid binary group is skipped rather than guessed at.