Home Tools Blog About

Convert Hex to Image

In short

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.

Enter hex colors to generate.
🛡
100% PrivateNo server uploads, ever
InstantRuns in your browser
💧
No WatermarksClean output, always
🆓
Free ForeverNo accounts, no limits

How to Use Convert Hex to Image

  1. 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.
  2. Pick a render mode: Solid fills with the first color; the three gradient modes interpolate smoothly through all colors in order.
  3. Set width and height (1-4096 px each). The canvas regenerates 200 ms after any change so you see the result as you adjust.
  4. Press Generate (or Ctrl+Enter / Cmd+Enter). Auto-generate also runs on input so results appear as you type.
  5. Read the stats line: total colors parsed, how many were valid, dimensions, pixel count, and estimated PNG byte size.
  6. Invalid colors are flagged in the error list below the canvas with the exact reason - the image still renders using just the valid ones.
  7. Copy the data URL or download the PNG. Copy puts the full data:image/png;base64,… string on your clipboard; Download saves a real .png file 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.

Keep going

Related Tools

All Hex tools →
Share

Embed this tool

Add this free tool to your website. Copy and paste the code: