Convert text to hexadecimal with this text to hex converter. It turns each character you type into its hexadecimal code. Type “Hello” and it returns 48656c6c6f, two hex digits for each letter.
RESULTS
How to Use This Calculator
- Enter Text: Input the text you want to convert.
- Click Calculate: The calculator will convert the text into its hex value.
- Read the result: one hex code per character, in lowercase, with no spaces between the codes.
For example, typing “Hello” gives 48656c6c6f, and typing “Hi 5” gives 48692035: 48 for H, 69 for i, 20 for the space and 35 for the digit 5.
Text to Hexadecimal Conversion Table
Here’s an example showing how each letter of the word “Hello” is converted into its hexadecimal equivalent:
| Character | Character code (decimal) | Hex value |
|---|---|---|
| H | 72 | 48 |
| e | 101 | 65 |
| l | 108 | 6c |
| l | 108 | 6c |
| o | 111 | 6f |
The calculator prints the letters a to f in lowercase. 6C and 6c are the same value.
To convert a character by hand, divide its code by 16. For H, 72 ÷ 16 = 4 remainder 8, so the hex code is 48. For l, 108 ÷ 16 = 6 remainder 12, and 12 is c in hex, so the code is 6c.
How the Text to Hex Converter Works
The calculator reads each character with JavaScript’s charCodeAt(), which returns the character’s UTF-16 code unit, a number from 0 to 65,535 (MDN). It writes each number in base 16, puts a 0 in front of a single-digit code, and joins the codes without spaces.
Characters with codes below 256, such as the English letters, digits, the space and common punctuation, give exactly two hex digits. Characters with higher codes give up to four digits. Emoji vary: the heart symbol gives one four-digit code, the grinning face gives two, and a flag gives four:
| You type | The calculator returns |
|---|---|
| Hello | 48656c6c6f |
| Hi 5 | 48692035 |
| A-Z! | 412d5a21 |
| é | e9 |
| € | 20ac |
| the heart symbol | 2764 |
| the grinning face emoji | d83dde00 (two UTF-16 code units, d83d and de00) |
| the US flag emoji | d83cddfad83cddf8 (four code units) |
Limits
- The result has no separators, so codes of different lengths run together. For plain English text, read it in pairs of digits.
- It converts characters, not numbers: typing 255 gives 323535, the codes for 2, 5 and 5.
- It gives UTF-16 code units. If you need the codes in another encoding, such as UTF-8 bytes, use a tool built for that encoding.
What is Hexadecimal?
Hexadecimal is a number system with a base of 16. It uses 16 symbols: 0-9 for values zero to nine, and A-F for values ten to fifteen. This system is often used in computing because it is more compact than binary, making it easier for humans to read large numbers.
For example:
- Decimal 10 is A in hex.
- Decimal 255 is FF in hex.
Why Use Hexadecimal?
Hexadecimal is widely used in programming and digital design. It’s a concise way to represent binary data and helps with memory addressing, color codes, and more.
Common Uses of Hexadecimal
Some common uses of hexadecimal conversions are:
1. Memory Addressing
Hexadecimal helps simplify the representation of memory addresses in computers.
2. Web Design
Colors in web design often use hex codes like #FFFFFF for white.
3. Data Encoding
In some encryption algorithms, data is encoded in hexadecimal for easy readability.
Our Text to Hex Calculator makes converting simple text into its hex equivalent quick and easy. Whether you’re working with web design, coding, or just need to understand how hex works, this tool is designed to help.
FAQs
1. Why would someone use a string-to-hex converter?
To see the exact character codes in a piece of text. A hex view shows things you cannot see on screen, such as a trailing space (20) or a look-alike letter from another alphabet, which has a different code.
2. Can this tool convert numbers or RGB colors to hex?
No. It converts characters, so typing 255 returns 323535: the codes for the characters 2, 5 and 5. To turn the number 255 into hex (FF), use the decimal to hex calculator.
3. Why are there no spaces in the result?
The calculator joins the codes together. For plain English text, split the result into pairs of digits: 48656c6c6f reads as 48 65 6c 6c 6f.
4. What is “hello” in hexadecimal?
“hello” in lowercase is 68656c6c6f, and “Hello” with a capital H is 48656c6c6f. “Hi” is 4869, and “Hello how are you” is 48656c6c6f20686f772061726520796f75.
5. Does it work with accented letters and emoji?
Yes, with longer codes: é gives e9 and € gives 20ac. Emoji give one, two or four four-digit codes: the heart symbol gives 2764 and the grinning face gives d83dde00. The codes are UTF-16 code units, not bytes.
Related Calculators: