Text to Hex Converter

Text to Hex Converter. Type your message into Text Input and the Text to Hex Converter instantly maps it to Hex Output. Type a base-10 number into the decimal to binary converter and its binary representation appears in Binary Output within seconds.

Need to see what your words look like to a computer? This text to hex converter is a free online tool that turns every character you type into its hexadecimal value, so "Zebra-9" becomes 5A 65 62 72 61 2D 39 in a click. Use it to turn text into hex for debugging, testing or plain curiosity.

What is text to hex conversion?

Text to hex conversion replaces each character in a string with the hexadecimal code that a character encoding assigns to it. A hex converter does this lookup for you: it takes the character, finds its decimal number in the encoding table, and writes that number in base-16. Hexadecimal uses sixteen symbols, the digits 0-9 and the letters A-F, which makes it a compact way to write binary data. Every hex digit stands for exactly four binary bits, so two hex digits describe one full byte. Type a decimal value into the decimal to bcd converter and each digit comes back as its own 4-bit binary nibble.

That is why a developer reaches for hex whenever raw data needs inspecting. A long run of ones and zeros is hard to read, while the same information as hex bytes is short enough to scan, compare and paste into a log entry or bug report. The base-16 numbering system is also the natural shorthand for decimal values that machines store in binary, so one short hex pair replaces eight bits.

One character, one decimal number, one pair of hex digits: that is the whole idea behind a hex encoder.

How to use this text to hex converter

You do not need to install anything. The widget above the article is a browser-based text to hexadecimal converter that works with plain text, symbols and emoji. Follow these steps:

  1. Paste your text into the input box, or type it directly. You can also upload files that contain the text you want to convert.
  2. Choose the character encoding, ASCII or UTF-8, and pick an output delimiter such as a space, a comma or nothing at all.
  3. Press the Convert button and read the hex output on the right.
  4. Copy the result, or download it to your device.

If you already have a hex string and want the original words back, switch to the hex to text tool and run the conversion in the opposite direction. Encoding and decoding are mirror operations, so a round trip should return exactly the input text you started with.

Choosing a delimiter and output format

The output format controls how the values are separated. A space gives you readable pairs like 5A 65 62, a comma suits spreadsheets and arrays, and an empty delimiter produces one continuous string such as 5A6562 for interfaces that expect no separators. Pick the hex format the receiving application expects before you copy.

The formula behind a text to hex string

Under the hood, every character goes through the same steps: look up its numeric code, divide that number by 16, and write the quotient and remainder as hex digits. For a single-byte character with decimal code \(n\), the high digit is the quotient and the low digit is the remainder: Enter hue, saturation, and value into the hsv to hex converter and it works out the matching hex color for you.

$$n = 16 \times h + l \quad\Rightarrow\quad \text{hex}(n) = h\,l$$

Take the letter Z. Its decimal code is 90, and \(90 = 16 \times 5 + 10\). The quotient 5 stays 5, and the remainder 10 is written as A, so Z becomes 5A. The same method works for every character in a text string, one at a time, and you simply join the results with your chosen delimiter. It is the same arithmetic any hex translator performs, only automated.

Formula card showing the ASCII code 90 for the letter Z split into quotient 5 and remainder 10 to give the hex byte 5A
The letter Z has ASCII code 90, which divides into 5 and 10 and is written as the hex byte 5A.

Worked example: converting "Zebra-9" to hexadecimal

Here is the complete conversion of the seven characters in "Zebra-9", using the standard ASCII table. The binary column shows the eight bits behind each ascii character, and the decimal column holds its ascii code.

Worked example: converting "Zebra-9" to hexadecimal
CharacterDecimalHexBinary
Z905A01011010
e1016501100101
b986201100010
r1147201110010
a976101100001
-452D00101101
9573900111001

Join the hex column with spaces and you get 5A 65 62 72 61 2D 39. Seven characters produce seven values, which is fourteen hex digits in total.

ASCII to hex versus Unicode to hex

The two encoding systems you will meet most often behave differently, and the difference decides how long your output is.

ASCII to hex

ASCII defines 128 characters, covering English letters, digits, punctuation and control codes. Each one fits in a single byte, so this conversion always yields exactly two hex digits per character. It suits log files, protocol commands and anything written in plain English. Keep the ASCII table open as your reference when you want to verify a value by hand.

Unicode to hex and UTF-8

Unicode assigns a unique code point to characters from every writing system, plus symbols and emojis. In UTF-8, the most common way to store those code points, a character may need one to four bytes. Take "Café €5": the letter C is 43, but the accented é becomes C3 A9 and the euro sign becomes E2 82 AC, so seven visible characters produce ten bytes: 43 61 66 C3 A9 20 E2 82 AC 35. This is how you find the encoded UTF8 hex representation of Unicode symbols, and why byte count and character count are not always equal.

Stacked bar chart comparing Zebra-9 at 7 UTF-8 bytes with a seven-character string containing an accented letter and a euro sign at 10 bytes
Both strings are seven characters long, but the accented letter and euro sign push the second to ten bytes.

Using the string to hex tool on longer data

The same string to hex logic scales from a single word to a whole configuration file. Because the hex converter runs in your browser, results appear instantly, even when you paste several paragraphs of data at once. Each character is processed independently, so a long input only grows the output in proportion; every character still adds exactly one value for ASCII, or up to four for rarer Unicode symbols.

When you work with larger data, split it into logical chunks first, such as one line per record. Convert each chunk, compare the hex values against what your program produced, and you will find a mismatch in seconds rather than hours. Many people keep a trusted hex code converter bookmarked for exactly this check, because it gives a neutral second opinion on what the data really contains. Since nothing is sent to a server, the process is also secure for internal strings, test fixtures and sample records.

Hex conversion table for common characters

A short conversion table saves lookups when you read hexadecimal values in a debugger or a packet capture. These entries cover the characters you will see most often.

Hex conversion table for common characters
CharacterHexMeaning
Space20Word separator
030First digit character
A41First capital letter
a61First lowercase letter
Line feed0ANew line on Unix systems
Tab09Horizontal tab

Notice that every lowercase letter sits exactly 32 (hex 20) above its capital, so changing case only flips one bit. Spotting patterns like this is one of the quiet benefits of working in hexadecimal encoding rather than decimal.

Checking a 12-byte name field with hex encoding

A support developer is chasing a failed import: a legacy billing system rejects the customer name Ortiz-Núñez, even though the field allows 12 characters and the name has 11. Suspecting encoding, they paste the name into the converter, choose UTF-8 and a space delimiter, and press Convert.

The output reads 4F 72 74 69 7A 2D 4E C3 BA C3 B1 65 7A. Counting the pairs gives 13 values, because ú (C3 BA) and ñ (C3 B1) each take two bytes in UTF-8. The same check on the plain surname Núñez returns 7 bytes for 5 characters, which confirms the pattern. The legacy field is measured in bytes, so 13 against a limit of 12 explains the rejection, and the cap set by the vendor, 12 bytes, is the real threshold, not the 12 characters shown in the form.

  • Characters entered: 11
  • UTF-8 bytes produced: 13
  • Field limit: 12 bytes, so the record is 1 byte over

Rather than strip the accents, which would change a customer's legal name, the developer raises the field to 40 bytes. That leaves room for a name of 20 two-byte characters, and a rerun of the import with the 13-byte value succeeds. The converter's hex dump turned a vague "invalid data" message into a concrete number the team could act on.

Why web developers convert text to hex

A hex dump is one of the oldest debugging aids in computing, and the reasons people still use it have not changed. A developer or any technical user can get value from it:

  • Debugging: inspecting raw data to spot hidden characters, stray whitespace or a wrong encoding.
  • Network communication: reading packets and writing protocol messages in compact form, or comparing network logs line by line.
  • Data serialization: storing text in a format that survives transfer between systems.
  • Low-level programming: writing memory values and color codes in a short form.
  • Cross-browser testing: checking that a web application converts to and from base-16 identically in every browser, even after the code is refactored.
  • Web development: building URL-safe values, escape sequences and character references.

Students and hobbyists use the same approach to learn how a machine represents language, since seeing the data in hex makes abstract ideas about binary and decimal numbers concrete. If you are one of the many web developers or programmers who check encoded values daily, a quick utility like this saves time.

How machines read hexadecimal code

Computers store everything as binary numbers, where each bit is either off (0) or on (1). People find long bit strings tiring, so engineers adopted the hexadecimal number system as shorthand for machine language. A base 10 decimal number such as 90 is familiar to humans, whereas the same value is 5A in hex and 01011010 in binary. Because sixteen is a power of two, converting between hex and binary is a simple digit-by-digit swap with no arithmetic: 5 is 0101 and A is 1010. Assembly language and many numeral system tools rely on this relationship, and a hex code is simply the readable face of that binary representation.

Text to hex conversion in code

You can reproduce what this tool does in a few lines. Here are two common approaches for developers who need to encode strings inside their own applications.

Python

"Zebra-9".encode("utf-8").hex(" ").upper()
# '5A 65 62 72 61 2D 39'

JavaScript

[...new TextEncoder().encode("Zebra-9")]
  .map(b => b.toString(16).padStart(2, "0").toUpperCase())
  .join(" ");

Both snippets use UTF-8, so they agree with the converter above for ASCII and non-ASCII input alike. Remember to pad single digits with a leading zero; a value like 0A must never shrink to A or the string will no longer translate back correctly, and the resulting error is easy to miss.

Tips for accurate hex encoding results

  • Match the encoding to the application that will read the hex value, and prefer UTF-8 for anything beyond basic English.
  • Keep the delimiter consistent so a decoder can split the values without guessing.
  • Check for invisible characters such as tabs or line breaks; each one adds its own value, for example 09 or 0A.
  • Count bytes, not letters, when a field has a size limit.
  • Use a second hex converter as a cross-check, and round-trip a short sample through the hex to text converter before you convert a large file.

Hex is an encoding, not encryption: anyone can decode it, so never treat it as security for passwords or private keys. For everyday use, though, converting text is quick and accurate, and when you need the reverse direction you can paste the hex into the decoder and get the original characters straight back.