Hex converter
Convert text to hexadecimal and back.

Hex converter is a free tool that converts text into hexadecimal byte values and converts valid hexadecimal data back into text.
What does this converter actually convert?
It converts the bytes that represent text, rather than converting a written number between numeric bases. Hexadecimal is a base-16 notation that uses the digits 0 through 9 and the letters A through F. One byte is normally written as two hexadecimal digits, from 00 through ff.
For example, enter Cat in the text-to-hex direction. The letters have byte values 43, 61, and 74 in hexadecimal, so the result is 436174. Converting 436174 back produces Cat.
| Text character | Decimal byte value | Hex byte value |
|---|---|---|
| A | 65 | 41 |
| Space | 32 | 20 |
| 0 | 48 | 30 |
| ? | 63 | 3f |

How do I use the text and hex directions?
Use To hex to encode text as hexadecimal, or To text to decode hexadecimal bytes. The conversion uses PHP's bin2hex and hex2bin functions, and the returned value appears in the result field labeled Hex. In the To hex direction, this field contains hexadecimal; in the To text direction, it contains decoded text despite the label.
- Choose To hex for text input or To text for hexadecimal input.
- Enter ordinary text for hexadecimal encoding, or enter hexadecimal digits for decoding.
- Read or copy the encoded hexadecimal or decoded text from the result field.

The work happens on the server. Your input travels to the server over HTTPS and is not stored. Because processing is server-side, do not submit passwords, private keys, or other secrets merely to inspect their byte values.
How should I read or prepare a hexadecimal value?
Read the result two digits at a time, with each pair representing one byte. The text-to-hex operation returns consecutive lowercase hexadecimal digits without separators.
Spaces and punctuation in source text are encoded as their own bytes. An empty text input corresponds to an empty hexadecimal result. Numbers entered as text are treated as characters, so the text 15 becomes 3135. It does not become 0f, which is the hexadecimal form of the numeric value fifteen.
That distinction is a common hand-conversion mistake. Another failure occurs when hexadecimal input has an odd number of digits or contains characters outside 0 through 9, A through F, and a through f. PHP's hex2bin operation requires complete byte pairs and valid hexadecimal digits.

Practical uses of hexadecimal
Hexadecimal is compact and maps cleanly to binary because each hex digit represents four bits. That makes it easier to inspect byte-oriented data than a long sequence of zeros and ones.
- Programming uses hex for byte arrays, memory addresses, Unicode code points, masks, and debugging output.
- Networking uses it in packet captures, protocol fields, MAC addresses, and IPv6 notation.
- Electronics uses hex for register values, firmware data, memory maps, and microcontroller documentation.
- Education uses it to demonstrate relationships among binary, decimal, bytes, and character encodings.
- Radio software and equipment documentation may display protocol frames, configuration bytes, or diagnostic values in hex.
This converter is suited to text and byte-oriented hex. For direct base conversion of numeric values, use Decimal converter or Binary converter instead.
Common questions about hex input
Why does one character sometimes produce more than two hex digits?
Many accented and non-Latin characters use multiple bytes in UTF-8. Each byte needs two hex digits, so one visible character may produce four, six, or more digits. Correct decoding requires the resulting bytes to be interpreted with the same character encoding.
Can I include a 0x prefix?
No. A prefix such as 0x41 is programming notation, but the x is not a hexadecimal digit accepted by hex2bin. Remove the prefix and enter 41.
Can this convert a CSS hex color to RGB?
No. A value such as #336699 represents red, green, and blue color channels, while this tool converts bytes to or from text. The leading hash mark is also invalid in raw hexadecimal input for decoding.
Why does decoded output contain unreadable characters?
Not every byte sequence represents readable text. The bytes may belong to a binary file, use another character encoding, or contain control characters that are not visibly rendered. A successful byte conversion does not guarantee meaningful text.
Can I paste a formatted packet dump directly?
Usually not without cleanup. Packet dumps often contain offsets, spaces, separators, ASCII sidebars, or labels that are not part of the byte sequence. Keep only the hexadecimal byte digits, remove formatting, and confirm that the final input has an even number of digits.
Similar tools
Popular tools
Create a WhatsApp chat link from a phone number, with an optional prefilled message.