YourTools.
简体中文
Back to the catalog
Tools

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

File to hex

Run

Processes in this browser; cancel at any time

Choose files first

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

  1. Choose up to 10 files of any type, or drop them on the page. You can also select Use example.
  2. Pick a “Layout”: “Hexdump with ASCII preview”, “Plain hex” or “C byte array”.
  3. Set “Bytes per line” to 8, 16 or 32, and tick “Uppercase hex” if you want capital letters.
  4. 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.