Skip to content

Text to Binary Converter

Use this Unicode-aware text-to-binary converter to encode text as real UTF-8 bytes. Copy grouped 8-bit binary or hexadecimal output, compare character, byte, bit, and line counts, and inspect the UTF-8 bytes generated by each Unicode code point.

5/10,000

UTF-8 binary

01001000 01100101 01101100 01101100 01101111
Code points
5
UTF-8 bytes
5
Bits
40
Lines
1

Hexadecimal bytes

The same UTF-8 bytes written in base 16.

48 65 6C 6C 6F

Character and byte inspector

See how each Unicode scalar value is encoded.

#CharacterCode pointUTF-8 hexUTF-8 binary
1HU+00484801001000
2eU+00656501100101
3lU+006C6C01101100
4lU+006C6C01101100
5oU+006F6F01101111

How to Convert Text to Binary

Type or paste text into the input panel. Conversion happens immediately, so there is no Convert button and no file upload step.

The UTF-8 binary panel shows one eight-digit group for every encoded byte. Use its copy control to copy the complete binary sequence, including spaces between byte groups.

The hexadecimal section shows the same bytes in base 16. Open the character and byte inspector when you need to see which Unicode code point produced each sequence.

This Converter Uses UTF-8, Not an ASCII-Only Shortcut

ASCII covers 128 values and assigns one byte to familiar English letters, digits, punctuation, spaces, and control characters. UTF-8 preserves those same byte values, so ASCII text produces the expected one-byte binary codes.

The difference appears when text contains characters outside ASCII. Accented letters, Greek, Arabic, Devanagari, Chinese characters, symbols, and emoji are encoded as valid multi-byte UTF-8 sequences rather than being removed, replaced with an arbitrary question mark, or forced into an eight-bit ASCII table.

This is why the tool can serve common ASCII-to-binary searches while still producing correct Unicode output for modern text.

How UTF-8 Turns Unicode Code Points Into Bytes

Unicode assigns an abstract code point to each encoded character. UTF-8 serialises each valid Unicode scalar value as a sequence of one, two, three, or four bytes.

Code points in the ASCII range use one byte. Higher code points use additional bytes, with leading-bit patterns that identify the first byte and continuation bytes.

The converter passes the string to TextEncoder and displays the resulting Uint8Array directly, so the output reflects the browser's UTF-8 encoding rather than a hand-maintained lookup table.

Surrogate code points are not Unicode scalar values and cannot be encoded directly in well-formed UTF-8. If the JavaScript string contains an unpaired UTF-16 surrogate, TextEncoder replaces it with U+FFFD and the interface reports that replacement.

UTF-8 byte length by Unicode code-point range

UTF-8 byte length by Unicode code-point range
Code-point rangeUTF-8 lengthBinary groupsCommon examples
U+0000–U+007F1 byte1 groupA, 7, space, line feed
U+0080–U+07FF2 bytes2 groupsé, ñ, Greek, Hebrew, Arabic letters
U+0800–U+D7FF and U+E000–U+FFFF3 bytes3 groupsMost Chinese, Japanese, and Korean characters; many symbols
U+10000–U+10FFFF4 bytes4 groupsMany emoji and supplementary-plane characters

Swipe horizontally to view the full table.

Understanding Binary, Hexadecimal, Character, Byte, and Bit Counts

Binary and hexadecimal are two representations of the same byte sequence. A byte such as hexadecimal 48 is binary 01001000; changing the number base does not change the encoded data.

The UTF-8 byte count measures encoded storage length. The bit count is always eight times that byte count because every displayed group represents one byte.

The interface's Code points metric counts Unicode scalar values after TextEncoder's lone-surrogate replacement step. It can differ from both byte count and the number of visible symbols a person perceives on screen.

What each result means

What each result means
ResultMeaningExample
UTF-8 binaryEvery encoded byte written as exactly eight binary digitsA → 01000001
Hexadecimal bytesThe same byte sequence written as two uppercase hexadecimal digits per byteA → 41
Code pointsUnicode scalar values counted after TextEncoder replaces any lone UTF-16 surrogates with U+FFFD🙂 counts as one code point even though it occupies four UTF-8 bytes
UTF-8 bytesLength of the byte array returned by TextEncoderé → 2 bytes
BitsUTF-8 byte count multiplied by eight5 bytes → 40 bits
LinesText segments separated by LF, CRLF, or CR line endingsTwo newline separators produce three lines

Swipe horizontally to view the full table.

Using the Character and Byte Inspector

Open the inspector to map each input code point to its Unicode notation, hexadecimal UTF-8 bytes, and binary UTF-8 bytes.

This is useful when a word contains a mix of one-byte ASCII characters and multi-byte Unicode characters, or when two pieces of text look similar but produce different bytes.

For performance, the table shows at most 200 code points. The main binary and hexadecimal outputs still include every byte from the accepted input.

Character inspector reference

Character inspector reference
ColumnWhat it showsWhy it is useful
CharacterThe Unicode scalar value actually encoded, with readable labels for common invisible charactersIdentify which part of the input produced the displayed bytes
Code pointThe Unicode scalar value in U+XXXX notationDistinguish characters that look alike but have different Unicode values
UTF-8 hexThe one-to-four-byte UTF-8 sequence in hexadecimalCompare with byte dumps, protocols, source files, and developer tools
UTF-8 binaryThe same bytes as grouped eight-bit valuesStudy the exact binary encoding of each code point

Swipe horizontally to view the full table.

Characters, Code Points, Code Units, and Grapheme Clusters

These terms describe different layers of text. A Unicode code point is an assigned numeric value such as U+0041 for A. JavaScript strings are internally organised as UTF-16 code units. UTF-8 is the byte encoding produced by this converter.

A user-perceived character, formally called an extended grapheme cluster, can contain more than one code point. For example, a letter followed by a combining accent can display as one symbol while the inspector shows two rows.

Some emoji sequences also join several code points with variation selectors or zero-width joiners. The tool intentionally exposes the underlying code points and bytes instead of pretending every visible symbol is one encoded value.

Spaces, Tabs, Line Breaks, and Other Invisible Bytes

Whitespace is encoded data. A space produces byte 20 in hexadecimal, a horizontal tab produces 09, and a line feed produces 0A.

The input panel preserves line breaks. The Lines metric recognises LF, CRLF, and CR separators, while the inspector gives common invisible characters readable labels.

Invisible differences matter when debugging source files, copied text, protocols, command output, and data that fails an exact byte comparison.

Common whitespace and control-byte examples

Common whitespace and control-byte examples
InputCode pointUTF-8 hexUTF-8 binary
SpaceU+00202000100000
Horizontal tabU+00090900001001
Line feedU+000A0A00001010
Carriage returnU+000D0D00001101
NullU+00000000000000

Swipe horizontally to view the full table.

Why Similar-Looking Text Can Produce Different Binary

Unicode can represent visually similar text with different code-point sequences. The precomposed character é uses U+00E9 and encodes as C3 A9 in UTF-8.

The decomposed sequence e followed by combining acute accent uses U+0065 U+0301 and encodes as 65 CC 81. The two versions can look alike while differing in code-point count, byte count, hexadecimal output, and binary output.

The converter does not normalise text before encoding. It preserves the sequence represented by the JavaScript input so users can observe those differences.

Practical Uses for a Text-to-Binary Converter

Students can compare letters, numbers, spaces, accented text, scripts, and emoji to understand variable-width character encoding.

Developers can verify UTF-8 examples, inspect copied text, compare a known hex dump, prepare test fixtures, or explain why a database, file, API, or protocol reports a specific byte length.

The tool is an encoder and teaching aid. It is not encryption, compression, hashing, a binary file viewer, or a way to hide sensitive information.

Choosing the useful output

Choosing the useful output
GoalUseful outputPractical note
Learn how ordinary text becomes bytesBinary output, hexadecimal output, and byte inspectorStart with short ASCII text, then compare accented letters and emoji.
Check a UTF-8 byte sequenceUppercase hexadecimal bytesCompare the result with a hex viewer, protocol trace, or file dump.
Explain why character and byte counts differUnicode code-point count and UTF-8 byte countNon-ASCII code points often require multiple bytes.
Prepare binary examples for teachingEight-bit byte groups separated by spacesEach group maps directly to one UTF-8 byte.
Inspect invisible textCharacter inspector and line countSpaces, tabs, and line endings produce real bytes even when they are hard to see.

Swipe horizontally to view the full table.

Input Limits, Copying, and Large Outputs

The text field accepts up to 10,000 UTF-16 code units. This browser-level length can differ from the displayed code-point count because supplementary Unicode code points use two UTF-16 code units.

A 10,000-unit input can produce substantially more than 10,000 UTF-8 bytes when it contains multi-byte characters. Binary output is therefore placed in a scrollable region rather than expanding without limit.

Binary and hexadecimal have separate copy controls. Copying writes only the selected output to the clipboard and does not submit the input to a server.

Privacy and Local Processing

Encoding uses TextEncoder inside the browser. The tool does not send text to an API, create an account record, upload a file, or place the input into a shareable URL.

The page calculates output from the current input state. Clearing the field removes the visible input and derived results from the component.

Browser extensions, clipboard managers, device policies, and the browser itself are outside the tool's control, so avoid processing secrets on devices or browsers you do not trust.

UTF-8 Binary Conversion Formulas

TextEncoder first produces a sequence of UTF-8 bytes. Each byte is then padded to eight binary digits or two hexadecimal digits for display.

Formula variables

An integer from 0 through 255 in the UTF-8 byte array
The ordered bytes returned by UTF-8 encoding
The number of bytes in the encoded Uint8Array
The total number of displayed binary digits before separators
Binary byte representation
Hexadecimal byte representation
Total bit count
Binary output sequence

Examples

ASCII letter

1

Input

A

Show result

Result

Binary: 01000001; hexadecimal: 41; 1 Unicode code point; 1 UTF-8 byte; 8 bits.

UTF-8 preserves the ASCII byte value for A.

English word

2

Input

Hello

Show result

Result

01001000 01100101 01101100 01101100 01101111

The five ASCII letters produce five bytes and 40 bits.

Accented Latin character

3

Input

é

Show result

Result

Binary: 11000011 10101001; hexadecimal: C3 A9; 1 code point; 2 UTF-8 bytes.

U+00E9 is outside ASCII and requires two UTF-8 bytes.

Chinese character

4

Input

Show result

Result

Binary: 11100100 10111101 10100000; hexadecimal: E4 BD A0; 1 code point; 3 UTF-8 bytes.

Emoji

5

Input

🙂

Show result

Result

Binary: 11110000 10011111 10011001 10000010; hexadecimal: F0 9F 99 82; 1 code point; 4 UTF-8 bytes.

Many emoji are supplementary-plane code points encoded with four UTF-8 bytes.

Precomposed and decomposed text

6

Input

Compare é with e followed by U+0301.

Show result

Result

Precomposed é: C3 A9. Decomposed e + combining acute: 65 CC 81.

The strings can look alike but contain different code points and bytes.

Text containing a space

7

Input

A B

Show result

Result

01000001 00100000 01000010

The middle group is the UTF-8 and ASCII space byte.

Frequently Asked Questions

How does the text-to-binary converter work?

It encodes the JavaScript string with the browser's UTF-8 TextEncoder, then formats every resulting byte as an eight-digit binary group.

Is this an ASCII-to-binary converter?

It supports ASCII text, and ASCII characters retain their familiar one-byte values in UTF-8. Unlike an ASCII-only converter, it also correctly encodes the rest of Unicode.

Why are binary digits grouped in sets of eight?

Each group represents one byte. UTF-8 is a byte-oriented encoding, so a code point that needs several bytes produces several eight-bit groups.

Why does one character sometimes produce multiple binary groups?

UTF-8 is variable-width. ASCII-range code points use one byte, while other code points require two, three, or four bytes.

Can the converter encode emoji?

Yes. TextEncoder supports Unicode text, and many emoji encode as four UTF-8 bytes. Joined emoji sequences can contain several code points and therefore many bytes.

Can it convert Chinese, Japanese, Arabic, Hindi, or other scripts?

Yes. The converter uses UTF-8 and can encode Unicode text from supported scripts rather than limiting input to English ASCII.

What is the hexadecimal output?

It is the same UTF-8 byte sequence written in base 16. Each byte appears as two uppercase hexadecimal digits.

Why is the character count different from the byte count?

The Code points metric counts Unicode scalar values after any lone-surrogate replacement, while the byte metric counts the UTF-8 storage required for those values. Non-ASCII code points often use multiple bytes.

Does the character count equal the number of visible symbols?

Not always. A visible grapheme can contain multiple code points, such as a letter plus a combining mark or an emoji joined from several components.

Why do two identical-looking words produce different binary?

Unicode sometimes allows precomposed and decomposed sequences that render similarly. The converter preserves the entered sequence and exposes its actual code points and bytes.

Are spaces converted to binary?

Yes. A regular space is hexadecimal 20 and binary 00100000 in UTF-8 and ASCII.

Are tabs and line breaks included?

Yes. Tabs, carriage returns, and line feeds are encoded as bytes and appear in the complete output. The inspector labels common invisible characters.

What does the Lines metric count?

It counts text lines separated by LF, CRLF, or CR line endings. Empty input reports zero lines.

What does the character and byte inspector show?

It maps each displayed Unicode code point to its U+ notation, hexadecimal UTF-8 bytes, and binary UTF-8 bytes.

Why does the inspector stop after 200 rows?

The row limit keeps large inputs responsive. Binary, hexadecimal, byte, bit, and code-point results still use the complete accepted input.

What is the maximum input length?

The text field accepts up to 10,000 JavaScript string units. Some supplementary Unicode code points occupy two UTF-16 string units, so this limit is not always the same as 10,000 displayed code points.

What happens to an unpaired UTF-16 surrogate?

TextEncoder replaces a lone high or low surrogate with U+FFFD before producing UTF-8. The converter reports the replacement instead of presenting the surrogate as a valid UTF-8 code point.

Does the converter add a UTF-8 byte-order mark?

No. TextEncoder returns the UTF-8 bytes for the entered string and does not prepend a BOM.

Can I choose UTF-16, UTF-32, or a legacy encoding?

No. The tool intentionally uses UTF-8 only so the output and inspector remain consistent and unambiguous.

Is binary conversion encryption?

No. Binary and hexadecimal are readable representations of encoded bytes. Anyone can convert them back when the encoding is known.

Can I copy the result?

Yes. Binary and hexadecimal outputs have separate copy controls. Clipboard access depends on browser support and permission.

Is my text uploaded or stored?

No. Encoding and inspection run locally in the browser, and the tool does not place the input into a public URL or send it to an encoding service.