EditSafely

Convert an Image to Hex Codes

Dump every pixel of an image as a #rrggbb hex color code.

Runs on your device, nothing uploaded

Drop an image anywhere on this page

or paste with Ctrl / ⌘ + V ·

Accepts any image

Your images never leave this tab

Convert an Image to Hex Codes is JavaScript that your browser has already downloaded, and it does the whole job on your own machine. On a normal site, 200 photos straight off a camera means 1.6 GB uploaded, a wait in somebody's queue, and 240 MB downloaded again. Here it means 0 bytes up and 0 bytes down.

  • No upload
  • No file size limit
  • Works offline once loaded
  • Nothing stored or logged

How to use Convert an Image to Hex Codes

  1. 1. Upload the image. Drop in a small image, since the output lists one hex code per pixel and large photos would produce an enormous amount of text.
  2. 2. Read the dumped pixel grid. The tool prints the image dimensions followed by each row of pixels as #rrggbb hex codes, arranged so the layout mirrors the original pixel grid.
  3. 3. Copy the hex output. Copy the full text of hex codes to paste into a spreadsheet, a script, or anywhere you need the exact color of every pixel represented as text.

When to use Convert an Image to Hex Codes

Convert an Image to Hex Codes dumps every pixel of a small image as a #rrggbb hex color code arranged in its original grid layout. It is for extracting exact per-pixel color data as plain text rather than viewing the image visually.

  • Feeding pixel data into code. A generative art script needs the exact hex color of each pixel in a tiny reference image to reproduce or manipulate it programmatically instead of loading image files at runtime.
  • Verifying an icon's exact colors. A designer needs to confirm the precise hex values used in a small icon before matching them in a style guide, rather than sampling colors manually with a picker tool.
  • Reconstructing pixel art from text. A tiny sprite or pixel-art image needs to be represented as plain text so it can be version-controlled, diffed or embedded directly in source code as a lookup table.

Examples

Read the pixels

Input

tiny.png

Output

# 2×1
#ff0000 #0000ff

About the Convert an Image to Hex Codes tool

Convert an Image to Hex Codes runs as plain JavaScript in your browser tab, with no server behind it. Dump every pixel of an image as a #rrggbb hex color code. Whatever you put in stays on your device from start to finish.

The tool is part of EditSafely's Image Tools section, 207 single-purpose utilities built around the same idea: open the page, get the result, keep your data to yourself.

There is nothing to configure. Provide the input and the result appears on its own. A worked example further down the page shows exactly what the tool produces for a real input.

That local-first design has practical benefits beyond privacy. The tool keeps working on a flaky connection once the page has loaded, there is no upload to wait for, and it is safe to use with confidential photos and documents.

Frequently asked questions

Is Convert an Image to Hex Codes free to use?

Yes, it is completely free. All 2,943 tools on EditSafely work without an account, a subscription or usage limits.

Are my files uploaded to a server?

Everything happens locally. Your browser downloads the tool's code once, then does all the processing itself; nothing you enter is transmitted, stored or logged. You can even go offline after the page loads and it will still work.

Which files does Convert an Image to Hex Codes accept?

It accepts images in any common format (PNG, JPG, WebP, GIF and more). There is no file size cap imposed by a server; very large files are limited only by your device's memory.

Do I need to sign up or install anything?

No. The tool works in any modern browser on desktop, tablet or phone. There is no account to create, no extension to add and no software to install.

How do I use the result?

Click Copy to put it on your clipboard, or Download .txt to save it as a file. Drop another image to start again.

Related tools

All Image Tools →