- 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++
- ChallengesNew
- For TeachersNew
Hex Decoder & Encoder
Decode hex to text and encode text to hex. Paste hex with or without spaces, 0x or \x prefixes; UTF-8 text comes back correctly.
🚀 177,247 total conversions (138 this month)
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"