Hex Text Converter
Fast, accurate and free online hex text converter tool running directly in your browser.
-
1Enter data
Enter content, paste text or load a file from disk. -
2Click the button
The tool will immediately process your data in the browser. -
3Get the result
Copy the finished text or save the file to your device.
return "Result ready in 0.1s";
}
Rate this tool:
Related tools
Other tools you may find usefulHEX ↔ text converter – ASCII, UTF-8 and hexadecimal bytes
Hex (hexadecimal) is the representation of binary data as a sequence of digits 0-9 and letters A-F. Each byte is 2 hex digits (FF = 255 = 11111111 in binary). The tool converts text to hex and back - useful in debugging protocols, analyzing binary data and learning encoding.
How text → hex conversion works
Each character has an ASCII/Unicode code. Example: "A" = ASCII 65 = 0x41. "Hello" → 48 65 6C 6C 6F. UTF-8 (Polish characters): "ą" (U+0105) → C4 85 (2 bytes). Separators: space (48 65 6C), none (48656C), prefix 0x (0x48 0x65).
Output formats
Hex without separator: 48656c6c6f. Hex with space: 48 65 6c 6c 6f. Hex with 0x prefix: 0x48 0x65. Hex uppercase: 48656C6C6F. C array: {0x48, 0x65, 0x6C, 0x6C, 0x6F}. Python bytes literal: b"\x48\x65\x6c\x6c\x6f". Whatever you want: the tool supports all formats.
Programming use cases
Network protocol debug (Wireshark, tcpdump): reading raw packet bytes. Binary file analysis: magic bytes (PDF: 25 50 44 46, PNG: 89 50 4E 47). Cryptography: keys and hashes in hex. IoT protocols (MQTT, Modbus): commands as hex strings. SQLi: 0x41414141 instead of AAAA.
Encodings – ASCII vs UTF-8 vs Latin-1
ASCII: 128 characters (0-127), 1 byte per character. Latin-1 (ISO-8859-1): 256 characters, 1 byte (Polish characters in Windows-1250). UTF-8: variable length (1-4 bytes), ASCII compatible for 0-127. "ą" UTF-8: C4 85 (2 bytes). "ą" Latin-2: B1 (1 byte). Select encoding in the tool.
FAQ
What are the magic bytes of common file formats?
PDF: 25 50 44 46 (%PDF). PNG: 89 50 4E 47 0D 0A 1A 0A. JPEG: FF D8 FF. ZIP: 50 4B 03 04 (PK). EXE (Windows): 4D 5A (MZ). Using magic bytes you can identify the file type regardless of the extension (file command in Linux, HxD Hex Editor).
How to read hex from the command line?
xxd file.bin: hex dump file. hexdump -C file.bin: hex + ASCII next. Python: open("f","rb").read().hex(). Node.js: Buffer.from("text").toString("hex"). The online tool replaces these commands for single conversions.
What is hex encoding vs Base64?
Hex: 2 characters per byte → size ×2. Readable but ineffective. Base64: ~1.33 characters per byte → size ×1.33. Less readable. Usage: hex – debugging and low-level protocols; Base64 – sending binary data in HTTP, email (MIME).
How to convert hex in JavaScript?
Text → hex: Array.from(str).map(c => c.charCodeAt(0).toString(16).padStart(2,"0")).join(" "). Hex → text: hexStr.match(/.{2}/g).map(h => String.fromCharCode(parseInt(h,16))).join(""). For UTF-8: use TextEncoder/TextDecoder instead of charCodeAt (supports multi-byte).
Does the tool support null bytes and binary data?
Yes – hex can contain 00 (null byte). Display: null bytes shown as 00, but conversion to text replaces them with the character U+0000. For binary data with null: use "binary display" mode instead of trying to render as text. The browser may truncate the string if null.
Related tools: Base64 converter, number system converter and JSON validator.