🔬 Binary File Viewer – Inspect Raw Bytes in Any Format
The Binary File Viewer is a browser-based tool that lets you inspect the raw bytes of any file without installing software. Upload a binary file and instantly see every byte rendered as hexadecimal, octal, decimal, or binary — all in a classic hex-editor-style layout with an ASCII panel on the right. Nothing leaves your browser; all processing happens locally using the FileReader API and typed arrays.
📋 Display Modes
Switch between four per-byte representations instantly without re-uploading the file:
| Mode | Example (byte 255) | Width | Best For |
|---|---|---|---|
| Hex | FF | 2 chars | General debugging, protocol analysis |
| Octal | 377 | 3 chars | Unix permissions, legacy systems |
| Decimal | 255 | 3 chars | Verifying integer byte values |
| Binary | 11111111 | 8 chars | Bit flags, bitmasks, bitfield analysis |
🔍 Magic Bytes & File-Type Detection
The viewer automatically reads the first 16 bytes and compares them against a library of 40+ file signatures — known as magic bytes. A badge near the file name instantly shows the detected type (e.g., PNG Image or ZIP Archive). This is especially useful when a file has been renamed or its extension has been stripped.
Common signatures detected:
| Magic Bytes (hex) | File Type |
|---|---|
89 50 4E 47 0D 0A 1A 0A | PNG Image |
FF D8 FF | JPEG Image |
25 50 44 46 | PDF Document |
50 4B 03 04 | ZIP / JAR / DOCX Archive |
7F 45 4C 46 | ELF Binary (Linux executable) |
4D 5A | Windows PE Executable (EXE/DLL) |
🔎 Byte Pattern Search & Highlighting
Enter any hex pattern — for example FF D8 FF for a JPEG marker or DE AD BE EF for a common sentinel value — to locate every occurrence in the file. All matching bytes are highlighted in yellow across the hex dump, and the total match count is shown next to the search bar. The viewer automatically navigates to the page containing the first match.
🧮 Value Inspector
Click any byte cell in the dump to open the Value Inspector, which decodes the bytes starting at that offset as every common C/C++ data type — in both little-endian and big-endian byte order:
• int8 / uint8 — single-byte signed and unsigned
• int16 / uint16 — 2-byte short integers
• int32 / uint32 — 4-byte integers
• float32 — 4-byte IEEE 754 single precision
• float64 — 8-byte IEEE 754 double precision
• uint64 — 8-byte unsigned 64-bit integer
This is essential for reading binary file headers — such as image width/height fields, audio sample rates, or length-prefixed protocol messages.
⚙️ How Byte Conversions Work
Each byte is a number between 0 and 255. The tool formats it differently per mode using JavaScript's built-in Number.prototype.toString(base):
// Hex: byte 65 → "41" (65).toString(16).padStart(2, '0').toUpperCase() // Octal: byte 65 → "101" (65).toString(8).padStart(3, '0') // Decimal: byte 65 → " 65" (65).toString(10).padStart(3, ' ') // Binary: byte 65 → "01000001" (65).toString(2).padStart(8, '0')
📄 Page Navigation for Large Files
To keep the browser responsive, the viewer renders 4,096 bytes per page. For files larger than 4 KB, Prev / Next buttons let you navigate through pages. The footer of the dump shows the exact byte range currently visible (e.g., Showing bytes 0–4,095 of 24,908).
🎨 Byte Color Coding
Bytes are color-coded for quick visual scanning:
• Default — printable ASCII characters (0x20–0x7E)
• Orange — non-printable control characters (0x01–0x1F, 0x7F)
• Blue — high bytes ≥ 0x80 (extended/binary data)
• Gray — null bytes (0x00)
• Yellow highlight — pattern search matches
📤 Export Options
Use Copy Hex to copy the current page's raw hex bytes to your clipboard as a space-separated string. Use Export to download a .hex.txt file containing the full xxd-style dump of the entire file — useful for sharing, code review, or offline analysis.