Hex Encode File
Encode any file as hex. Drop a file, get the Hex text. Copy or download.
Encode any file as hex. Drop a file in your browser, get the Hex-encoded text. Copy or download. Free, offline, runs entirely client-side. Read more Show less
What is
Hex is a binary-to-text encoding. It represents arbitrary bytes using a limited set of printable ASCII characters, so that binary data can be safely transmitted through systems that only handle text: email bodies, JSON strings, URL parameters, configuration files.
This tool encodes a whole file rather than a short string, and produces a text output that can be copied or downloaded as .txt. For the text-only version, see Hex Encode.
How to use
Drop a file into the drop zone, or click it to browse. The tool reads the file, encodes the bytes as Hex, and shows the result. Copy it or download it as a .txt file.
Files up to 5 MB are supported. Everything runs in your browser - the file never leaves your device.
FAQ
Is there a file size limit?
Yes - 5 MB on the encode side. Larger files produce enormous text that is impractical to display in a browser textarea. For huge files, use the equivalent command-line tool (see the CLI section below).
Is my file uploaded anywhere?
No. Everything runs in your browser. You can verify this by opening your browser's Network tab - no requests are sent after page load.
How much does Hex inflate the size?
Hex doubles the size (2 characters per byte). Base32 expands by 8/5 (1.6-). Base58 expands by roughly 1.37-. Base64 expands by 4/3 (1.33-). The output metadata shows the exact ratio for your file.
Which encoding should I pick?
Base64 is the most common and the most compact of the four. Hex is the easiest to read by eye. Base32 is used in DNS and some TOTP secrets. Base58 is used by Bitcoin and IPFS. If you have no specific requirement, use Base64.
Command line equivalent
# Node - encode a file to Hex
node -e '
const fs = require("fs");
const buf = fs.readFileSync("input.bin");
const out = buf.toString("hex");
fs.writeFileSync("output.txt", out);
'
# Command line tools
# Hex: xxd -p input.bin > output.txt
# Base32: base32 input.bin > output.txt (coreutils)
# Base58: use a Bitcoin CLI tool
# Base64: base64 input.bin > output.txt