Hex to Image Converter — Decode Hex to PNG / JPG, Free
Convert hex-encoded image data back to a viewable PNG / JPG / GIF. Useful for forensics, debugging. Browser-only.
About Convert Hex to Image
Image bytes can be encoded as hex strings — every two hex chars become one byte. The result is platform-independent text that round-trips back to the original binary. The ZTools Hex to Image converter takes a hex string (with or without 0x prefix, with or without spaces / line breaks), decodes the bytes, detects the image format from the magic bytes (PNG: 89 50 4E 47, JPG: FF D8 FF, GIF: 47 49 46 38), and renders the image. Useful for forensics, debugging email payloads, decoding base64-via-hex pipelines, and copying images out of hex dumps.
Use cases
- Decode an image embedded in a log. A debug log shows a hex blob; you suspect it's an image. Paste, see what it is.
- Forensics — extract images from a dump. A memory dump has a PNG at offset X. Cut the hex starting from 89 50 4E 47, end at IEND chunk; decode to view.
- Verify a hex-encoded image API response. Some APIs encode images as hex strings. Decode to confirm the bytes match expectations.
- Round-trip an image through copy-paste-able text. Need to send an image through a system that only supports text? Hex-encode → paste → decode at the destination.
How it works
- Paste hex string. Tool strips whitespace + 0x prefixes. Each pair of hex chars becomes one byte.
- Detect format. Magic bytes identify PNG / JPG / GIF / BMP / WebP. Unknown formats display as "data" with size info.
- Render. Decoded bytes turned into a Blob → object URL → <img src>. Image displays in the browser.
- Download. Save as the detected format. Filename auto-generated.
Examples
Input: 89 50 4E 47 ... (PNG header) ... AE 42 60 82
Output: Decoded as PNG, displayed in viewer. Save as .png.
Input: FF D8 FF E0 ... (JPG header)
Output: Decoded as JPG.
Input: Random hex with no recognised header
Output: Tool reports "unknown format" with byte count. Image won't render.
Frequently asked questions
What if my hex has commas or extra chars?
Tool strips non-hex chars before decoding. Most common dump formats (Wireshark, hexdump, xxd) round-trip cleanly.
Maximum size?
A few MB hex (which decodes to 1-2 MB image) works fine. Larger ones strain the browser tab.
Doesn't recognise my format?
Toggle "raw mode" to download as .bin and open in a hex editor. The first 16 bytes usually identify the format manually.
Privacy?
Everything in browser.
Pro tips
- For partial hex dumps, ensure the magic-byte header is present. Without it, format detection fails.
- For images embedded in larger data, find the IEND chunk (50 4E 47 ... 49 45 4E 44) for the PNG end marker, or FF D9 for JPG end.
- For round-trip testing, also use the Image to Hex tool — verify the same bytes round-trip.
Reviewed by Ahsan Mahmood · Last updated 2026-05-06 · Part of ZTools.
For the full,
formatted version of this page, please enable JavaScript and reload
https://ztools.zaions.com/hex-to-image.