Hex String Converter
Encode text to hex strings or decode hex back to text.
Encode text to hex strings or decode hex back to text. Enter your numbers and get an instant result.
Convert text to a hex string or a hex string back to text, in the character encoding you choose, for both directions in one page.
It is an encoding, not a digest: hex is reversible, so the output is the input in another alphabet rather than a fingerprint of it.
How to use Hex String Converter
Set action to to_hex to encode or from_hex to decode, type the value in input, and set encoding to the text codec, UTF-8 by default.
When decoding, paste hex without spaces or 0x prefixes: bytes.fromhex rejects anything that is not even-length hex.
Non-UTF-8 bytes decode only when encoding names their real codec; decoding Shift-JIS bytes as UTF-8 is an error, not mojibake to keep.
Both directions, one encoding field
To hex, each character is encoded to bytes and written as two hex digits each. From hex, the pairs are regrouped into bytes and decoded in the encoding you selected, so the encoding must match the one used to encode or the result is wrong.
A mismatched encoding shows up as a decode failure when the bytes are not valid in the target, and as different characters when they are. The page cannot tell which encoding produced a string, so it does not guess.
The action you must name
The direction is an explicit field: to hex or from hex. An unrecognised action is refused with the value it received, and empty input is refused before either direction runs, since an empty result would say nothing about whether the conversion worked.
Nothing is stored and nothing is uploaded to a third party: the string is posted to this site's executor for the transform and answered from there.
What to Expect
Best for
- Converting a hex value from a log line back to text.
- Producing the hex form of a string for a protocol field.
What this tool keeps
- The input string, the direction and the encoding are the whole input; the converted string is returned and nothing is retained.
Sample input
action from_hex, input `48656c6c6f`, encoding utf-8
Sample output
`Hello`, decoded from those bytes in UTF-8, with the direction and encoding echoed.
Frequently asked questions
Why did decoding give the wrong characters?
Because the encoding field did not match the encoding used to produce the hex. The bytes are reinterpreted, not repaired, so the wrong choice yields plausible-looking wrong text.
Is a hex string a hash?
No. It is reversible: anyone can turn it back into the original text without a key.
What happens if I mistype the action?
It is refused with the value it received, rather than defaulting to one direction and quietly producing something else.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.