EditSafely

Convert Pixels to Integers

Turn hex color pixels into their 24-bit integer values.

Runs on your device, nothing uploaded

Byte order
Try:

0 chars · 0 lines

Output

Turn hex color pixels into their 24-bit integer values.

Type or paste above to see the result here.

Example: Black and white pixels

What you paste never leaves this tab

Convert Pixels to Integers is JavaScript that your browser has already downloaded, and it does the whole job on your own machine. On a normal site, whatever you type in is sent to a server that can log it, cache it or keep it. Here it is read and transformed inside this tab and nowhere else.

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

How to use Convert Pixels to Integers

  1. 1. Paste the hex color pixels. Enter one or more colours separated by spaces or new lines: #ff8800, the short #f80 or rgb(255, 136, 0). A swatch appears beside each result.
  2. 2. Read the 24-bit integer values. Keep RGB to get 0xRRGGBB as a decimal integer, so #ffffff becomes 16777215, or pick BGR for Windows COLORREF values, where #ff8800 becomes 35071.
  3. 3. Copy the integer values. Copy the resulting decimal numbers into code or documentation where colors need to be represented as plain integers rather than hex strings.

When to use Convert Pixels to Integers

Convert Pixels to Integers turns hex color codes into their 24-bit integer equivalents, which is how many graphics APIs and file formats represent color internally. Reach for it whenever you need the numeric form of a color rather than its hex string.

  • Preparing color constants for a graphics API. Some graphics or game engine APIs expect colors passed as a single 24-bit integer rather than a hex string. Convert your design team's hex palette here before writing the constants.
  • Debugging a color-encoding function. You wrote code that packs RGB values into a single integer and want to verify your packing logic produces the same result as this tool for a few known colors.
  • Comparing colors stored in different formats. One system logs colors as hex strings and another logs them as raw integers, and you need to confirm two log entries actually refer to the same color.
  • Understanding how RGB values combine into one number. A lesson on color representation is clearer when students can see exactly how #000000 and #ffffff map to 0 and 16777215 as single integers.

Examples

Black and white pixels

Input

#000000 #ffffff

Output

0
16777215

The leading # is optional

Input

ff0000 00ff00 0000ff

Output

16711680
65280
255

Short hex and rgb() colours

Input

#f80 rgb(255, 136, 0)

Output

16746496
16746496

About the Convert Pixels to Integers tool

Convert Pixels to Integers does its work locally, right in the browser. Turn hex color pixels into their 24-bit integer values. There is no upload step, no queue and no account, and your data never travels over the network.

It belongs to the Integer Tools collection on EditSafely, a set of 133 small, focused Integer utilities that share the same instant, private workspace.

You can shape the output with the Byte order setting, and the result refreshes the moment you change it. 3 worked examples further down the page show exactly what the tool produces for real inputs.

Running locally also makes the tool fast and dependable: results appear as soon as your input does, there is no server outage that can take it down mid-task, and confidential data can be processed without a second thought.

Frequently asked questions

Does Convert Pixels to Integers cost anything?

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

Is it safe to paste sensitive or confidential data?

No data leaves your device. The whole tool is JavaScript that runs inside your browser tab, so there is no upload, no server-side processing and no log of what you did. If you disconnect from the internet after the page loads, it keeps working.

How much text can I process at once?

There is no fixed limit; your device's memory is the ceiling. Up to 10 MB the result updates as you type, after a short pause that grows with the size. Above 10 MB a Run button appears so typing stays smooth, and files open up to 50 MB. A very long result shows its first 2,000 lines on screen, while Copy and Download always include all of it.

Do I need to sign up or install anything?

Nothing to install and no account needed. Open the page in any up-to-date browser, including on a phone or tablet, and the tool is ready.

How do I use the result?

The output panel has a one-click copy button, and you can keep refining the input while you work; the result updates in place as you type.