Home › File & PDF Tools › Grayscale Image Converter
Grayscale Image Converter
A grayscale image converter turns a color photo into a black-and-white image in seconds, right in your browser. Upload a PNG, JPEG, GIF, BMP, or WebP picture, and this free tool converts every pixel to grey using the luminosity method, shows the original and the converted version side by side, and lets you download the result as a PNG. Nothing is uploaded to a server, so your photos stay on your device.
Drop an image here, or click to choose a file
PNG, JPEG, GIF, BMP, or WebP — processed in your browser, never uploaded.
Your image stays on your device. The tool only reads its pixels to convert them to grey.
How it works
Every pixel in a color image has three numbers: red, green, and blue, each from 0 to 255. A pixel of pure red is (255, 0, 0), white is (255, 255, 255), and black is (0, 0, 0). To make a grayscale image, the tool replaces each pixel's three numbers with a single grey value, used for red, green, and blue alike. A pixel becomes grey (g, g, g), where g is a brightness number between 0 and 255. The question is how to pick g so the black-and-white picture still looks like the original — and that is where the luminosity method comes in.
The simplest way to pick g would be a plain average: add red, green, and blue, and divide by three. That works, but it looks wrong, because human eyes are not equally sensitive to all three colors. We see green light far more brightly than blue light, so a green pixel looks brighter to us than a blue pixel with the same number. The luminosity method corrects for this by weighting the channels: green counts for the most, red for about a third, and blue for the least. The weights come from the standard used in television and video, and they match how the human eye perceives brightness.
Take a pure red pixel, (255, 0, 0). The formula gives 0.299 × 255 + 0.587 × 0 + 0.114 × 0 = 76.245, which rounds to 76, so the pixel becomes grey (76, 76, 76) — a fairly dark grey, because red contributes only about thirty percent of perceived brightness. A pure green pixel, (0, 255, 0), becomes 0.587 × 255 = 149.685, or 150 — a much lighter grey, because green dominates what we see. A pure blue pixel, (0, 0, 255), becomes 0.114 × 255 = 29.07, or 29 — nearly black, because blue contributes the least. White (255, 255, 255) stays white at 255, and black (0, 0, 0) stays black at 0, so the full range of tones is preserved.
Before any conversion starts, the tool checks that your file really is an image. It reads the first few bytes of the file — the magic bytes — and matches them against the known signatures for PNG, JPEG, GIF, BMP, and WebP. A PNG file always starts with the bytes 89 50 4E 47, a JPEG starts with FF D8 FF, a GIF starts with the letters "GIF8", a BMP starts with "BM", and a WebP file starts with "RIFF" followed by "WEBP".
The conversion itself happens on a canvas in your browser. The tool draws your image onto a canvas at its original size, reads every pixel, applies the luminosity formula to each one, and writes the grey values back. The original image is shown on the left and the converted image on the right, so you can compare them before downloading. The converted image keeps the exact width and height of the original, and the Download button saves it as a PNG, a lossless format that stores the grey shades exactly.
Worked example
Take a small photo of a red flower against green leaves. Upload it and press Convert to grayscale.
Step 1: The tool reads the file, confirms the magic bytes match a JPEG, and loads the image. It reports the size — for example, 3024 by 4032 pixels and 2.1 MB.
Step 2: The original photo appears on the left of the preview, in full color.
Step 3: The tool converts every pixel with the luminosity formula. A bright red petal pixel of (255, 0, 0) becomes grey (76, 76, 76). A green leaf pixel of (0, 180, 0) becomes 0.587 × 180 = 105.66, rounded to 106, so grey (106, 106, 106).
Step 4: The converted image appears on the right. The red petals are now a mid-dark grey, the green leaves a slightly lighter grey — the flower is still clearly a flower, just without color.
Step 5: Press Download PNG to save the black-and-white version at the same 3024 by 4032 size.
Try it yourself: upload any colorful photo and press Convert to grayscale. Compare the two previews — notice how green areas stay brighter than red or blue areas of similar strength. That is the luminosity method doing its job, and it is why the result looks like a real black-and-white photograph instead of a flat, washed-out copy.
FAQ
What is a grayscale image converter?
A grayscale image converter turns a color photo into a black-and-white image by replacing every pixel's color with a shade of grey. Each pixel keeps its brightness but loses its hue, so a bright red and a bright green that looked very different in color can end up as similar greys. The result is a classic black-and-white photo that works well for printing, documents, and artistic effects.
How does the luminosity method work?
The luminosity method converts each pixel with the formula grey equals 0.299 times red plus 0.587 times green plus 0.114 times blue. Green counts for the most because human eyes are most sensitive to green light, red counts for about a third, and blue counts for the least. For example, a pure red pixel (255, 0, 0) becomes grey (76, 76, 76), because 0.299 times 255 is about 76. This method gives a more natural-looking black-and-white image than a simple average of the three channels.
What image formats can I convert?
You can convert PNG, JPEG, GIF, BMP, and WebP images. The tool checks the first bytes of the file, called magic bytes, to confirm the format is really one of those types, rather than trusting the file name alone. If you upload a different kind of file, such as a PDF or a text file, the tool shows a friendly error message and asks you to choose an image instead. The converted image is always downloaded as a PNG.
Are my images uploaded to a server?
No. Everything happens in your own browser on your own device. Your image is read with the FileReader API, drawn on a canvas, converted pixel by pixel, and downloaded from that same canvas, and it is never sent to any server. That also means the tool works offline once the page has loaded, and there is no limit on how many images you can convert in a row.
Will the converted image keep its original size?
Yes. The converted image keeps the exact width and height of the original, in pixels, because the tool converts every pixel in place instead of resizing the picture. The downloaded file is saved as a PNG, which is a lossless format, so the grey shades are preserved exactly. Only the file size may change, because a PNG stores the grey image differently from the original JPEG or WebP file.