- Executors
-
Learn
Learn Python Runnable examples, NumPy, pandas, and more Learn AINeural networks, ML and LLMs from scratch Learn C & C++ Pointers, memory, STL, and modern C++ Learn C#C# basics, OOP, LINQ, async, and .NET exercises Learn MatplotlibLine, bar, scatter and pie charts with live visualizers Python Algorithms Search, sorting, recursion, and visualizers O(n) C & C++ Algorithms Compare algorithms implemented in C and C++ Coding for Kids Learn to code by playing!
- ChallengesNew
- For TeachersNew
- For KidsNew
- Updates
- Buy me a coffee
AI Hex Decoder & Encoder
Paste hex in any format and get the text instantly, or turn text into hex. Not sure what a hex string is? AI explains it and decodes the Base64, gzip or XOR inside.
🚀 177,382 total conversions (273 this month)
Byte inspector
| Size | |
|---|---|
| Decimal | |
| Little-endian | |
| Signed | |
| Binary | |
| Octal | |
| UUID | |
| Color | |
| Base64 |
Hex dump
Practice Python with coding challenges
Solve hands-on problems right in this editor: run the sample tests, submit, and get an AI code review.
Introduction
This online Hexadecimal encoder tool makes it easy to convert strings into hexadecimal format and back again. Whether you're working with text or numbers, this tool simplifies the process and saves you time.
How to Use This Tool
- Paste your string directly into the editor or type it in.
- Click the Encode or Decode button to convert your string to or from hexadecimal format.
-
After encoding or decoding, you can:
- Download the result.
- Save or share it with others using a short link.
- Sign in with Google or GitHub to save your results to your account for later use.
What is Hexadecimal?
Hexadecimal (or hex) is a base-16 numbering system that simplifies the representation of binary data. It uses 16 symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. Each hex digit represents a 4-bit binary sequence, making it much easier to write and read binary numbers.
For example:
- Binary to Hex:
11010100→D4 - Hex to Binary:
FFFF3→11111111111111110011
Why Use Hexadecimal?
Hexadecimal is commonly used in computing and digital systems because it is more compact and readable than binary. It’s often used for memory addresses, color codes, and representing data in ASCII or Unicode character sets.
For more details, check out this helpful guide.
Examples
Before encoded
Hello, World!
After encoded
48656c6c6f2c20576f726c6421
Decode hex to text: formats it reads
Paste hex the way you found it. The decoder removes spaces, commas, colons and 0x, \x or % prefixes, then turns every two digits into one byte.
| Hex you paste | Text you get |
|---|---|
48656c6c6f | Hello |
48 65 6c 6c 6f | Hello |
0x48 0x65 0x6c 0x6c 0x6f | Hello |
\x48\x65\x6c\x6c\x6f | Hello |
48:65:6c:6c:6f | Hello |
c3 a9 74 c3 a9 | été |
f0 9f 98 80 | 😀 |
Bytes are read as UTF-8, so accented letters, Cyrillic, Chinese, Japanese, Korean and emoji decode correctly.
Is hex a cipher?
Puzzles and CTFs often call it a "hex cipher", but hex is an encoding, not encryption: each pair of digits is one byte, and anyone can read it back with a decoder like this one. To hide data, use real encryption; to check that data has not changed, use a hash such as SHA-256.
How to decode hex by hand
Split the hex into pairs. Each pair is a number from 0 to 255: the first digit counts sixteens and the second counts ones (a = 10 to f = 15). Look the number up in the ASCII table to get the letter.
48 → 4 × 16 + 8 = 72 → "H"
65 → 6 × 16 + 5 = 101 → "e"
6c → 6 × 16 + 12 = 108 → "l"
Hex to ASCII table
Printable ASCII characters by hex value: row is the first digit, column the second. 41 is "A", 61 is "a", 20 is a space.
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2 | ␠ |
! |
" |
# |
$ |
% |
& |
' |
( |
) |
* |
+ |
, |
- |
. |
/ |
| 3 | 0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
: |
; |
< |
= |
> |
? |
| 4 | @ |
A |
B |
C |
D |
E |
F |
G |
H |
I |
J |
K |
L |
M |
N |
O |
| 5 | P |
Q |
R |
S |
T |
U |
V |
W |
X |
Y |
Z |
[ |
\ |
] |
^ |
_ |
| 6 | ` |
a |
b |
c |
d |
e |
f |
g |
h |
i |
j |
k |
l |
m |
n |
o |
| 7 | p |
q |
r |
s |
t |
u |
v |
w |
x |
y |
z |
{ |
| |
} |
~ |
DEL |
Decode hex in code
The same conversion in common languages (UTF-8 text):
# Python
bytes.fromhex("48656c6c6f").decode("utf-8") # 'Hello'
"Hello".encode().hex() # '48656c6c6f'
// JavaScript (Node.js)
Buffer.from("48656c6c6f", "hex").toString("utf8") // 'Hello'
Buffer.from("Hello").toString("hex") // '48656c6c6f'
// Go
b, _ := hex.DecodeString("48656c6c6f") // string(b) == "Hello"
// PHP
hex2bin("48656c6c6f"); // 'Hello'
// C#
Encoding.UTF8.GetString(Convert.FromHexString("48656c6c6f"));
# Bash
echo 48656c6c6f | xxd -r -p # Hello
Hex decoder FAQ
How do I decode hex to text?
Paste the hex into the right box. It turns into text on the left as you type, in any format: 48656c6c6f, 48 65 6c 6c 6f, 0x48 0x65, \x48\x65, 48:65 or a hex dump from xxd. Type text on the left to get its hex.
Why does the decoded text show strange characters?
The bytes are not text in the selected encoding. Try UTF-16 or Latin-1 in "Text encoding". If it still looks like noise, the hex is binary data such as a hash, a key or a file: the byte inspector shows what it probably is, and Explain with AI can tell you more.
What does 0x mean in hex?
0x marks a hexadecimal number in C, Java, JavaScript, Python and most other languages, so 0x41 is 65 in decimal, the letter "A". The decoder removes 0x, \x and % prefixes for you.
How do I convert hex to decimal?
Paste the hex and look at the byte inspector: it shows the number in decimal (big-endian and little-endian), signed, binary and octal. For example FF is 255, and 01 00 is 256 in big-endian or 1 in little-endian.
What is the difference between hex and Base64?
Both write bytes as text. Hex uses two characters per byte, so it doubles the size but is easy to read. Base64 uses four characters for every three bytes, about 33% bigger, which is why it is used in emails, data URLs and JSON. If you paste Base64 here, the page offers to convert it.
Can I decode a hex dump or a whole file?
Yes. Paste output from xxd or hexdump -C and the offsets and text columns are ignored. Use "Open file" to see any file as hex, and "Download bytes" to save decoded hex as a file: PNG, JPEG, PDF, ZIP and other types are detected from their first bytes.
What does Explain with AI do?
It tells you what an unknown hex string probably is: a hash, a UUID, a file header, a network packet or text that is encoded again (Base64, gzip, XOR, ROT13). When more decoding steps are needed, your browser runs them and shows the result, so you see the real decoded data, not a guess.
Is my data sent to a server?
No. Decoding, encoding and the byte inspector run in your browser. The hex is only sent when you press Explain with AI, and then only to answer that question.