About the Text Encoding Converter
Text Encoding Converter changes text into the numbers computers store and back again. Pick a direction and a format: hexadecimal, decimal, octal or binary bytes of the UTF-8 encoding, UTF-16 code units, Unicode code points such as U+0041, HTML numeric entities or JavaScript \u escapes. Choose a separator, a prefix such as 0x and capital letters, and the result appears as you type. Decoding accepts spaces, commas, line breaks and prefixes and gives a clear message when a value is not valid. Because it uses UTF-8 and Unicode rather than plain ASCII, accented letters, non-Latin scripts and emoji work, and a byte counter shows how large the text is. Everything runs in your browser and nothing is uploaded.
Updated September 2026
How to use the Text Encoding Converter
- 1Choose Text to code or Code to text.
- 2Pick a format, such as hex, decimal, octal, binary, UTF-16, code points, HTML entities or \u escapes.
- 3For text to code, set the separator, prefix and letter case if you want to change them.
- 4Type or paste your text or code.
- 5Copy the result, or press the switch button to send it back through the reverse conversion.
How text becomes numbers
Computers store text as numbers. The Unicode standard gives every character, from letters and digits to symbols and emoji, a code point. A text encoding such as UTF-8 or UTF-16 turns those code points into bytes or code units that can be saved in a file or sent over a network. The same text can therefore be written as hex bytes, as decimal ASCII codes, as binary or as code points, and all of them describe the same characters.
This tool lets you see and convert between the common views. That is useful for debugging encoding problems, learning how characters are stored, writing test data and preparing values for code.
Choosing a format
- Hex, decimal, octal, binary: the UTF-8 bytes of your text, in the base you choose.
- UTF-16 code units: how JavaScript, Java and Windows store the text.
- Code points: the Unicode number of each character, written as U+0041.
- HTML entities: numeric references such as H that can be pasted into web pages.
- \u escapes: the form used inside JavaScript and JSON strings.
Reading and fixing problems
When decoding, the tool removes spaces, commas and prefixes, and reads each value in the base you selected. If a value has a wrong digit for the base or is too large, the message names it so you can fix it. If the bytes decode to invalid UTF-8, the input was probably in another encoding, such as Latin-1 or a sequence cut in the middle of a character.
The counter under the input shows characters and bytes. A single emoji is one character but four bytes, and an accented letter is one character and two bytes, which explains why some text is longer than it looks when it is stored or sent.
Related tools
Binary Translator changes plain text to binary and back with more layout choices, Base64 Encoder and Decoder and Base32 and Base58 Encoder produce text-safe encodings, URL Encoder and Decoder handles percent codes, and Number Base Converter converts single numbers between bases. Hash Generator turns text into fixed-length fingerprints.
Features
- Eight formats including code points and HTML entities
- Full Unicode support with emoji
- Choice of separator, prefix and letter case
- Decoding that ignores spaces, commas and prefixes
- Clear errors for invalid bytes and values
- Character and byte counter
- One-click switch to check the round trip
- Runs in your browser
Frequently asked questions
How do I convert text to hex?
Choose Text to code, pick Hex and type your text. Each byte of the UTF-8 encoding becomes two hex digits, so Hello becomes 48 65 6c 6c 6f. Use the separator and prefix options for other layouts such as 0x48,0x65.
How do I convert hex back to text?
Choose Code to text, pick Hex and paste the values. Spaces, commas, line breaks and 0x prefixes are ignored, and a run of digits with no separator is split into pairs. If the bytes do not form valid UTF-8, the tool tells you.
What is the difference between UTF-8 bytes and Unicode code points?
A code point is the number given to a character in the Unicode standard, such as U+00E9 for é. UTF-8 stores it as one to four bytes, so é is the two bytes c3 a9. The hex, decimal, octal and binary formats show bytes, while the code point format shows the character numbers.
Does it work with emoji and other languages?
Yes. The tool uses UTF-8 and Unicode, so 👋 becomes the four bytes f0 9f 91 8b, or the code point U+1F44B. In UTF-16 it appears as the surrogate pair d83d dc4b.
What is UTF-16 and when do I need it?
UTF-16 stores characters as 16-bit code units and is used by JavaScript, Java and Windows. Characters outside the first 65,536 need two units called a surrogate pair. Use this format to see what a string looks like in those systems or to write \u escapes.
How do I get ASCII codes for a message?
For plain English text, the decimal format gives the ASCII codes, for example A is 65. ASCII is the first 128 values of UTF-8, so the numbers match for letters, digits and common punctuation.
Why does decoding say a value is bigger than one byte?
The byte formats read each number as a single byte from 0 to 255. If you have values above 255, they are probably code points or UTF-16 units, so choose one of those formats instead.