Convert Hex to Image
Render hex colors as PNG images - solid fill or horizontal/vertical/diagonal gradient. Supports 3/4/6/8-digit hex with alpha. Free, offline, client-side.
- Runs in your browser
- Nothing uploaded
- Free, no sign-up
Turn one or more hex color codes into a PNG image. Pick a solid fill or a horizontal / vertical / diagonal gradient. Supports 3-, 4-, 6-, and 8-digit hex with alpha; the # is optional. Up to 4096 × 4096 pixels.
How to Use Convert Hex to Image
- Enter one or more hex colors - separated by commas, spaces, or newlines. Accepts 3-digit (
#f00), 4-digit with alpha (#f00a), 6-digit (#ff0000), and 8-digit (#ff0000aa). Case-insensitive,#optional. - Pick a render mode: Solid fills with the first color; the three gradient modes interpolate smoothly through all colors in order.
- Set width and height (1-4096 px each). The canvas regenerates 200 ms after any change so you see the result as you adjust.
- Press Generate (or Ctrl+Enter / Cmd+Enter). Auto-generate also runs on input so results appear as you type.
- Read the stats line: total colors parsed, how many were valid, dimensions, pixel count, and estimated PNG byte size.
- Invalid colors are flagged in the error list below the canvas with the exact reason - the image still renders using just the valid ones.
- Copy the data URL or download the PNG. Copy puts the full
data:image/png;base64,…string on your clipboard; Download saves a real.pngfile named after the canvas dimensions.
Frequently Asked Questions
Which hex formats does this accept?
All four standard forms, all with an optional leading # and in any case: #RGB (3-digit shorthand, each nibble doubled), #RGBA (4-digit with alpha), #RRGGBB (6-digit standard CSS), and #RRGGBBAA (8-digit with alpha byte, where 00 is fully transparent and FF is fully opaque).
How does gradient mode handle multiple colors?
Colors are placed at equally-spaced stops along the gradient. Two colors give a simple fade; three give a midway transition; four or more create multi-band gradients. The direction (horizontal / vertical / diagonal) controls only the visual axis – color distribution is always even along that axis.
How big can the image be?
Up to 4096 × 4096 pixels. Beyond that, browsers start throttling canvas allocations. On a modern laptop, even a 4K diagonal gradient renders in under 300 ms. If you need larger output (for print), render several tiles and stitch them in an image editor.
What does the alpha channel do?
For 4-digit (#RGBA) and 8-digit (#RRGGBBAA) hex, the last nibble/byte controls transparency. #FF000080 is red at 50% alpha. The downloaded PNG preserves alpha as a true transparency channel – in gradient mode, alpha interpolates smoothly like RGB channels.
What happens if one of my colors is invalid?
Only that entry is dropped. The image renders with just the valid colors, and the error list below the canvas shows the exact problem (wrong character count, non-hex character, etc.) for each bad entry. You don’t lose your other inputs to a typo.
Can I use the generated images commercially?
Yes. The output has no watermarks and no license restrictions imposed by this tool – use it in client work, commercial design, print, social media, or anywhere. Note that standard intellectual-property rules still apply if you’re encoding copyrighted brand color palettes.
Is my hex input uploaded anywhere?
No. Everything runs client-side via the Canvas 2D API – hex codes never leave your device, no requests fire during generation. You can confirm this in your browser’s Network tab. The tool keeps working even after you disconnect from the internet.
Why does the preview background look checkered?
The preview area uses a transparent-checkerboard background so you can see alpha channels clearly. When you download the PNG, the transparency is preserved as a real alpha channel (not painted against the checkerboard). The downloaded file will composite over whatever background you place it on.
How does this differ from the “hex codes to image” tool?
This one focuses on solid fills and smooth gradients – few colors, many pixels each. The “hex codes to image” tool in the Image category focuses on pixel-art and swatches – many colors, few pixels each. Use this one for backgrounds and gradient hero images; use the other for encoding color palettes or sprite data.
Can I copy the image data URL to embed directly in HTML?
Yes. The Copy button puts the full data:image/png;base64,… string on your clipboard, which works as-is in an <img src>, CSS background-image: url(…), or any tool that accepts data URLs. No upload to an image host required.
Related Tools
Add Hex Numbers →
Add Hex Numbers instantly. Free, offline, client-side tool that outputs results in both hex…
ASCII to Hex Converter →
Convert ASCII to Hex - code points or UTF-8 bytes, space/comma/0x-prefixed, uppercase or lowercase.…
Base32 to Hex Converter →
Base32 to Hex Converter - pick separator, case, and prefix. Free, client-side, instant, offline,…
Base58 to Hex Converter →
Decode Bitcoin, Ripple, or Flickr Base58 strings to hex - with separator, case, and…
Base64 to Hex Decoder →
Decode Base64 to hex bytes - URL-safe variant, separator options, uppercase toggle, UTF-8 aware.…
BCD to Hex Converter →
Convert packed BCD to hexadecimal - decimal-value or nibble mode, BigInt precision, COMP-3 sign.…
Convert Decimal to Hex →
Convert decimal numbers to hexadecimal instantly, individually or in bulk. Free, client-side converter with…
Convert Gray Code to Hex →
Decode Gray code (reflected binary) to hex, decimal, or binary. Accepts binary or hex-packed…
Convert Hex to ASCII →
Decode hexadecimal bytes to ASCII text. Auto-detect separators, handle non-printable bytes four ways, batch…
Convert Hex to BCD →
Convert hex to Binary Coded Decimal - packed, unpacked, or COMP-3 with sign nibble.…
Convert Hex to Binary →
Convert hex to binary with nibble-accurate bit widths. 5 grouping modes, 0b prefix toggle,…
Convert Hex to Decimal →
Convert hex to decimal with BigInt precision. Explicit bit-width two's complement for signed values,…