How To Encode Text To Binary
📖 Bu rehber ToolPazar ekibi tarafından hazırlanmıştır. Tüm araçlarımız ücretsiz ve reklamsızdır.
What a byte holds
ASCII (1963, standardized in ANSI X3.4-1968) defines 128 characters in 7 bits. Letters, digits, punctuation, and control codes.
ASCII — 7 bits per character
The 8th bit is zero in pure ASCII. Many systems historically used the extra bit for extended character sets (“high ASCII” for accented letters, box-drawing), with every vendor picking a different mapping — the mess that Unicode was invented to end.
UTF-8 — Unicode in 1 to 4 bytes
UTF-8 (RFC 3629) is the dominant encoding on the modern web. It encodes every Unicode code point using 1 to 4 bytes:
UTF-16 and UTF-32
For encodings wider than 1 byte (UTF-16, UTF-32, binary numbers), the order of bytes matters.
Endianness
To encode “Hi” to ASCII binary:
Converting step by step
In JavaScript:
7-bit framing
Pure ASCII output is sometimes written with 7 bits per character, dropping the leading zero:
Base-N conversions
Used historically in 7-bit serial protocols and email transports before 8-bit MIME became universal. In 2026 this is primarily a puzzle-design choice or a bandwidth trick on constrained radio links.
Real uses today
Binary is base-2. Related encodings use more compact bases:
Character encoding detection
Given a binary blob, is it ASCII, Latin-1, UTF-8, or something else? Heuristics:
Common mistakes
All bytes under 0x80 → safe to interpret as ASCII or UTF-8.
Run the numbers
Bytes 0x80–0xBF never appear first in UTF-8 — if one starts a “character,” it is not valid UTF-8.