- ตัวรันโค้ด
-
เรียนรู้
เรียน Python ตัวอย่างที่รันได้, NumPy, pandas และอื่น ๆ เรียน AI / Machine Learningโครงข่ายประสาท ML และ LLM ตั้งแต่ศูนย์ เรียน C และ C++ พอยน์เตอร์ หน่วยความจำ STL และ C++ สมัยใหม่ เรียน C#พื้นฐาน C#, OOP, LINQ, async และแบบฝึกหัด .NET เรียน Matplotlibกราฟเส้น แท่ง กระจาย และวงกลม พร้อมตัวแสดงภาพแบบโต้ตอบ เรียน RustOwnership, trait, การจัดการข้อผิดพลาด และ thread เรียน GoSlice, interface, goroutine และ channel อัลกอริทึม Python การค้นหา การเรียงลำดับ รีเคอร์ชัน และภาพจำลอง O(n) อัลกอริทึม C และ C++ เปรียบเทียบการเขียนด้วย C และ C++ เขียนโปรแกรมสำหรับเด็ก เรียนเขียนโปรแกรมผ่านการเล่น! AP CSPรันซูโดโค้ด แบบทดสอบฝึกหัด และเครื่องคำนวณคะแนน
- ควิซใหม่
- โจทย์ใหม่
- สำหรับครูใหม่
- อัปเดต
- เลี้ยงกาแฟสักแก้ว
Hex Decoder & Encoder - ถอดรหัส Hex
วาง hex รูปแบบใดก็ได้แล้วได้ข้อความทันที หรือแปลงข้อความเป็น hex ไม่แน่ใจว่า hex นี้คืออะไร? AI จะอธิบายและถอดรหัส Base64, gzip หรือ XOR ที่อยู่ข้างในให้
🚀 แปลงไปแล้ว 177,388 ครั้ง (เดือนนี้ 279 ครั้ง)
ตัวตรวจไบต์
| ขนาด | |
|---|---|
| ฐานสิบ | |
| Little-endian | |
| มีเครื่องหมาย | |
| ฐานสอง | |
| ฐานแปด | |
| UUID | |
| สี | |
| Base64 |
Hex dump
ฝึก Python ด้วยโจทย์เขียนโค้ด
แก้โจทย์จริงใน editor นี้: รันทดสอบตัวอย่าง ส่งคำตอบ และรับรีวิวโค้ดจาก AI
บทนำ
เครื่องมือเข้ารหัสเลขฐานสิบหกออนไลน์นี้ทำให้ง่ายต่อการแปลงสตริงเป็นรูปแบบเลขฐานสิบหกและกลับมาอีกครั้ง ไม่ว่าคุณจะทำงานกับข้อความหรือตัวเลข เครื่องมือนี้จะทำให้กระบวนการง่ายขึ้นและประหยัดเวลาของคุณ
วิธีการใช้เครื่องมือนี้
- วางสตริงของคุณลงในตัวแก้ไขโดยตรงหรือพิมพ์เข้าไป
- คลิกปุ่ม Encode หรือ Decode เพื่อแปลงสตริงของคุณเป็นหรือจากรูปแบบเลขฐานสิบหก
-
หลังจากการเข้ารหัสหรือถอดรหัส คุณสามารถ:
- ดาวน์โหลดผลลัพธ์
- บันทึกหรือแชร์กับผู้อื่นโดยใช้ลิงก์สั้น
- ลงชื่อเข้าใช้ด้วย Google หรือ GitHub เพื่อบันทึกผลลัพธ์ของคุณในบัญชีสำหรับการใช้งานในภายหลัง
เลขฐานสิบหกคืออะไร?
เลขฐานสิบหก (หรือ hex) เป็นระบบเลขฐาน 16 ที่ทำให้การแสดงข้อมูลไบนารีง่ายขึ้น มันใช้สัญลักษณ์ 16 ตัว: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F แต่ละตัวเลขฐานสิบหกแทนลำดับไบนารี 4 บิต ทำให้ง่ายต่อการเขียนและอ่านตัวเลขไบนารี
ตัวอย่างเช่น:
- ไบนารีเป็นเลขฐานสิบหก:
11010100→D4 - เลขฐานสิบหกเป็นไบนารี:
FFFF3→11111111111111110011
ทำไมต้องใช้เลขฐานสิบหก?
เลขฐานสิบหกถูกใช้บ่อยในคอมพิวเตอร์และระบบดิจิทัลเพราะมันกระชับและอ่านง่ายกว่าไบนารี มันมักถูกใช้สำหรับที่อยู่หน่วยความจำ, รหัสสี, และการแสดงข้อมูลในชุดอักขระ ASCII หรือ Unicode
สำหรับรายละเอียดเพิ่มเติม โปรดดูที่ คู่มือที่เป็นประโยชน์นี้.
ตัวอย่าง
ก่อนเข้ารหัส
Hello, World!
หลังเข้ารหัส
48656c6c6f2c20576f726c6421
ถอดรหัส hex เป็นข้อความ: รูปแบบที่รองรับ
วาง hex ตามที่คุณเจอได้เลย ตัวถอดรหัสจะลบช่องว่าง จุลภาค โคลอน และคำนำหน้า 0x, \x หรือ % แล้วแปลงทุกสองหลักเป็นหนึ่งไบต์
| Hex ที่วาง | ข้อความที่ได้ |
|---|---|
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 | 😀 |
ไบต์ถูกอ่านเป็น UTF-8 ภาษาไทย ตัวอักษรมีวรรณยุกต์ ภาษารัสเซีย จีน ญี่ปุ่น เกาหลี และอีโมจิจึงถอดรหัสได้ถูกต้อง
Hex เป็นรหัสลับหรือไม่?
ในปริศนาและ CTF มักเรียกว่า "hex cipher" แต่ hex เป็นการเข้ารหัสรูปแบบข้อมูล (encoding) ไม่ใช่การเข้ารหัสลับ (encryption) ทุกสองหลักคือหนึ่งไบต์ และใครก็อ่านกลับได้ด้วยตัวถอดรหัสแบบนี้ ถ้าต้องการซ่อนข้อมูลให้ใช้การเข้ารหัสจริง ถ้าต้องการตรวจว่าข้อมูลไม่ถูกแก้ ให้ใช้แฮชอย่าง SHA-256
วิธีถอดรหัส hex ด้วยมือ
แบ่ง hex เป็นคู่ แต่ละคู่คือตัวเลข 0 ถึง 255 หลักแรกนับหลักสิบหก หลักที่สองนับหลักหน่วย (a = 10 ถึง f = 15) แล้วเปิดตาราง ASCII เพื่อหาตัวอักษร
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.