File to Hex Converter
Convert any file to hexadecimal — continuous, space- or colon-separated, a C/JS byte array or \x-escaped — and turn hex back into a downloadable file with its type auto-detected. Runs in your browser; nothing is uploaded.
Input
Any file type, up to 10.00 MB. Read locally — never uploaded.
Hex
Choose a file to see it as Hex.
Also available with
Guides
Turn any file into hexadecimal text, or paste hex and get the original file back. Useful for embedding a small binary in source code, inspecting file signatures, comparing two files byte by byte, or rebuilding a file from a hex string you found in a log, a packet capture or a firmware dump.
How to use it
File → Hex
- Choose a file (up to 10 MB). It is read locally and encoded immediately.
- Pick an output format:
- Continuous —
48656c6c6f - Space-separated —
48 65 6c 6c 6f - Colon-separated —
48:65:6c:6c:6f - C / JS array —
0x48, 0x65, 0x6c, ready to paste between{ }or[ ] - Escaped string —
\x48\x65\x6c, for C, Python or shell string literals
- Continuous —
- Set how many bytes go on each line, and switch to uppercase if you prefer
A-F. - Copy the result or download it as a text file.
Hex → File
- Paste hex in any of the formats above — spaces, line breaks, colons, commas,
0xand\xprefixes and surrounding braces are all ignored. - Leave File type on Auto-detect (the type is recognised from the file's first bytes) or pick one, and optionally name the file.
- Press Decode and download the file. Images, audio and video get an inline preview.
What counts as valid hex
Only the digits 0-9 and letters A-F (either case), two per byte. An odd number of digits is reported as an error rather than guessed at, since a half byte almost always means the paste was cut off.
Detected formats
PDF, PNG, JPEG, GIF, WebP, BMP, ZIP, GZIP, MP3, WAV, OGG, FLAC, MP4/M4A and WebM. Anything else downloads as a .bin file you can rename.
Privacy
Encoding and decoding run entirely in your browser. Your file never leaves your device.
Related tools
For text rather than files, use Text to Hex and Hex to Text. To read a file as an offset + hex + ASCII listing like xxd, use the Hex Dump Viewer. Other encodings: File to Base32, File to Base64.