Skip to main content

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

Drop a file or browse
One file · any type

Any file type, up to 10.00 MB. Read locally — never uploaded.

Hex

Choose a file to see it as Hex.

Was this helpful?

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

  1. Choose a file (up to 10 MB). It is read locally and encoded immediately.
  2. 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
  3. Set how many bytes go on each line, and switch to uppercase if you prefer A-F.
  4. Copy the result or download it as a text file.

Hex → File

  1. Paste hex in any of the formats above — spaces, line breaks, colons, commas, 0x and \x prefixes and surrounding braces are all ignored.
  2. Leave File type on Auto-detect (the type is recognised from the file's first bytes) or pick one, and optionally name the file.
  3. 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.

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.

hexhexadecimalfilebinaryencodedecodebyte arraybase16

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.