File to hex
Show any file as hex: a hexdump with offsets and an ASCII preview, plain hex, or a C byte array.
Process locally
Files stay in this browser session. Closing or clearing releases them.
Choose files
Any file, up to 10
Drop files here, or
Adjust settings
Optional: Layout, Bytes per line, Uppercase hex
Run
Processes in this browser; cancel at any time
About this tool
Turn any file into hex text: a hexdump with offsets and an ASCII preview, plain hex, or a C byte array. Use it to read a file's header and find its real format, to look for odd bytes in a binary file, or to embed a small icon or certificate in firmware code.
Up to 10 files and 5 MB in total go into one hex.txt, each under a line with its name, with 8, 16 or 32 bytes per line and optional uppercase letters. Everything runs in your browser, and the files are not uploaded.
How to use it
- Choose up to 10 files of any type, or drop them on the page. You can also select Use example.
- Pick a “Layout”: “Hexdump with ASCII preview”, “Plain hex” or “C byte array”.
- Set “Bytes per line” to 8, 16 or 32, and tick “Uppercase hex” if you want capital letters.
- Select Run, preview the beginning, then download hex.txt for the full text.
Formats and limits
- Input
- Any file, up to 10 files
- Output
- Plain text
- Size limit
- 5 MB in total
- Settings
- Layout (Hexdump with ASCII preview, Plain hex, C byte array); Bytes per line (8, 16, 32); Uppercase hex
- Privacy
- Files stay in the current browser session. No file bytes are uploaded.
- Price
- Free, no sign-up
Common questions
What do the columns in the hexdump mean?
The layout matches hexdump -C: the offset in hex on the left, that line's bytes in two halves in the middle, and the matching ASCII characters between bars on the right. The last line gives the file's total size in hex.
Why does the preview show only the beginning?
The preview shows the first 20,000 characters, which in the hexdump layout at 16 bytes per line is roughly the first 4 KB of the file. Download hex.txt for the complete text.
How can I tell a file's real format?
Look at the first bytes of the dump: PNG files start with 89 50 4e 47, PDF files with 25 50 44 46 (%PDF) and ZIP files with 50 4b 03 04.
Why is Chinese text shown as dots in the ASCII column?
The ASCII column shows only printable ASCII letters, digits and symbols, and every other byte as a dot. A Chinese character usually takes three bytes in UTF-8, none of them printable ASCII, so each byte shows as a dot.
What does the C byte array look like?
The output looks like unsigned char data[N] = { 0x48, 0x65, … }; where N is the number of bytes. The array is always named data, and each line holds as many bytes as “Bytes per line” says.
Related tools
Byte radix and endianness converter
Convert bytes between hex, binary, octal, unsigned or signed decimal, Base64 and UTF-8 text, and swap byte order between big and little endian in 2, 4 or 8-byte words.
Base64 to image or file
Turn Base64 or a data: URI back into a file such as an image; the type comes from the content or the URI.
Character set encoding and mojibake repair
Show the bytes of text in UTF-8, GBK, GB18030, Big5, Shift_JIS and more as hex, turn hex back into text, or repair mojibake from text read in the wrong character set.
Image or file to Base64
Encode images or any other file as Base64 or as a data: URI to paste into HTML, CSS or JSON.
Encode and decode text
Encode or decode Base64, Base64URL, URL, hexadecimal or HTML entities. Encoding is not encryption.
Number base converter
Convert integers of any size between bases 2 and 36, one per line, with optional two’s complement for signed 8 to 128-bit values.