🗂️ File to Hex Converter – Inspect Any Binary File in Your Browser
The File to Hex Converter reads any file you upload and displays its raw binary content as a hexadecimal dump — the same format produced by the classic xxd and hexdump command-line utilities. The entire conversion happens locally in your browser using the Web File API; no data ever leaves your device.
What Is a Hex Dump?
Every file on your computer is stored as a sequence of bytes — numbers between 0 and 255. A hex dump represents each byte as a two-digit hexadecimal value (00 – FF), grouped into rows with three columns:
- Offset — the byte address of the first byte in that row (shown in hex or decimal).
- Hex bytes — the raw byte values, e.g.,
48 65 6C 6C 6F. - ASCII panel — printable characters shown alongside their hex counterparts; non-printable bytes appear as a dot (
.).
00000000 48 65 6C 6C 6F 20 57 6F 72 6C 64 0A Hello World.Who Needs a Hex Dump?
Hex dumps are an essential tool across many disciplines:
- Developers debugging binary protocols, serialization formats, or file parsers.
- Security researchers inspecting malware samples, firmware images, or encrypted payloads.
- Students learning about file formats, encoding, and low-level data representation.
- Forensic analysts examining unknown files or recovering data from corrupt storage.
- Embedded engineers validating microcontroller flash images and binary patches.
Key Features
Beyond basic conversion, the tool offers several features designed for real-world use:
- Magic byte detection — the first 16 bytes are checked against a library of 40+ file signatures. PNG, PDF, ZIP, ELF, JPEG, MP4, and many more formats are automatically identified.
- SHA-256 integrity hash — a cryptographic fingerprint of the original file is computed using the browser's built-in Web Crypto API, letting you verify file integrity at any time.
- Printable ASCII ratio — shows what percentage of bytes fall in the printable ASCII range (0x20–0x7E), giving you an instant sense of whether a file is text or binary.
- Byte range slicing — set a Start Byte and End Byte to inspect a specific segment without converting the entire file.
- Raw hex string mode — outputs a flat string (e.g.,
48656C6C6F) instead of a formatted dump, ready to paste into code or other tools. - Flexible separators — choose between space (
48 65), no separator (4865), comma (48,65), or0xprefix (0x48 0x65) to match your target language or environment. - Copy & Download — copy the hex output to your clipboard with one click, or save it as a
.hexor.txtfile.
Understanding File Formats via Magic Bytes
Every well-known file format begins with a characteristic sequence of bytes called magic bytes or a file signature. For example:
89 50 4E 47 0D 0A 1A 0A— PNG imageFF D8 FF— JPEG image50 4B 03 04— ZIP archive (also used by DOCX, XLSX, JAR, APK)7F 45 4C 46— ELF executable (Linux/Android)25 50 44 46— PDF document (%PDFin ASCII)
When a file has been renamed or its extension removed, the magic bytes are the most reliable way to determine its true type. This tool highlights the detected type in a color-coded badge alongside the file name.
Performance & Privacy
Files up to 50 MB are supported. For very large files, only the first 64 KB of the selected byte range is rendered in the interactive viewer at a time — you can use the Start Byte / End Byte controls to navigate any section, and the Download button saves the full output. All processing is performed entirely within your browser; no file contents are uploaded to any server.