Threshold an Image to Pure Black and White
Turn a photo or a scan into clean two tone black and white, with automatic Otsu, a manual cut-off, or adaptive thresholding for pages that were lit unevenly.
Drop images here or click to choose
JPG, PNG, WebP, GIF, BMP and more. Add as many as you like.
Method
Auto finds the split with Otsu. Manual lets you set it. Adaptive uses a local average, which is the one for uneven lighting.
Polarity
Dark on white is the normal scanned page look.
People also use
Methods
Otsu automatic, manual cut-off, and adaptive local mean
Adaptive engine
Integral image, so a big window costs the same as a small one
Tested claim
On a lit gradient, global kept 1040 dark pixels left but 72 right. Adaptive gave 216 and 216
Output
Exactly two values, 0 and 255. No grey in between
Files uploaded
None. Everything runs in your browser
Price
Free, no account, no watermark
How to threshold an image
- 1
Add the image or scan
Drop your file onto the box above. Photos, phone pictures of documents and scanned pages all work, and so do several files at once.
- 2
Pick a method
Start with Auto. If the page was lit unevenly, switch to Adaptive and set the window radius to about the size of your largest letter. Use Manual only when you want a specific value.
- 3
Apply and save
Press Apply threshold to run it at full resolution and save the result. The settings you chose apply to every file in the list.
How this compares
| What you get | FlipMyFormat | Photopea | LunaPic |
|---|---|---|---|
| Free without an account | |||
| Images stay on your device | |||
| Automatic Otsu threshold | |||
| Adaptive local thresholding | |||
| Several images in one go | |||
| Shows you the value it picked | |||
| No watermark on the result |
Global, automatic and adaptive, and when to use each
Thresholding is the oldest trick in image processing and still one of the most useful. Every pixel is measured for brightness, then it becomes either black or white depending on which side of a line it falls on. The only real question is where to put that line.
A global threshold puts one line across the whole picture. That is perfect for a flat scan from a real scanner, where the paper is evenly lit end to end. It fails badly on a photo of a page taken with a phone, because your hand shadows one corner and the window brightens another. The dark corner drops below the line and turns solid black, taking the text with it.
Adaptive thresholding fixes that by asking a local question instead of a global one: is this pixel darker than its own neighbourhood. Ink is always darker than the paper right next to it, no matter how bright that paper happens to be, so text survives everywhere. The window radius controls what counts as the neighbourhood. Too small and the inside of a thick letter looks like paper to itself and hollows out. Too large and you are back to a global threshold. About the size of your biggest character is the usual sweet spot.
The bias value shifts the decision slightly toward keeping ink. Raising it is the standard cure for grey speckle on textured or recycled paper, where the local average sits very close to the paper itself and small variations flip pixels randomly.
Everything runs in this page on your own device. Nothing is uploaded, so you can threshold a signed contract, a bank statement or a patient form without those pixels ever crossing the internet.
A threshold is often the last step rather than the first. Remove colour with Grayscale Image or fix a dim scan with Brightness and Contrast before you come here, and if you want outlines rather than filled shapes use Edge Detect instead.
Automatic, using Otsu
Otsu tries every possible cut-off and keeps the one that separates dark and light pixels most cleanly. There is a subtlety: on a clean two tone image every value between the two peaks scores identically, so a naive version returns the first one and lands right on the dark peak. This tool collects the whole plateau of equal scores and returns its midpoint, which is why a 40 and 210 test image gives 125 rather than 40.
Adaptive, for uneven lighting
When one side of a page is bright and the other is in shadow, no single cut-off can work. Adaptive compares each pixel with the average of a window around it instead. On a test page with a lighting gradient, the global method kept 1040 dark pixels on the bright side but only 72 on the dark side. Adaptive kept 216 on each.
Why it is fast
The local averages come from an integral image, a running sum built in one pass. After that, the average of any rectangle is four lookups, so a 121 pixel wide window costs the same as a 7 pixel one. You can drag the radius slider freely without the preview slowing down.
What you get out
Exactly two pixel values, 0 and 255, with no grey between them. That is what OCR engines, fax style formats, screen printing, laser engraving and PDF bitonal compression expect, and it is why a thresholded scan is often a fraction of the size of the original.
What people use image thresholding for
Clean up a phone photo of a document
This is the single most common reason people come here. A photo of a page always has uneven light, so pick Adaptive, set the window radius to about the height of your largest letter, and raise the bias if the paper still shows grey speckle.
Prepare a scan before running OCR
Most OCR engines binarise internally anyway, and giving them a clean two tone page means fewer wrong guesses on faint or bleeding text. It will not rescue a blurred or very low resolution photo, but on a decent scan it usually helps.
Make a black and white logo from a photo
Manual mode with a hand picked cut-off is the right choice here, because you want a specific look rather than a statistically optimal split. Try a few values, then trace the result in a vector tool if you need a scalable file.
Create a stencil for screen printing or vinyl
Screen printing and cutting both need pure black and white with no grey, which is exactly what this produces. Check the preview for thin isolated specks, since those become tiny fragments that a cutter cannot hold.
Shrink a scanned page before emailing it
An image with only two values compresses extremely well as PNG, often to a small fraction of the original. Feed a PNG in rather than a JPG, because JPG adds soft grey fringes around every letter and undoes the benefit.
Read faint pencil, old ink or a receipt
Faded writing that is barely visible in a photo often jumps out once the paper is forced to white and the marks to black. Adaptive with a small radius and a higher bias is the combination that usually finds it.
On your device
Windows
Drag a scan from File Explorer onto the box. If you scanned to PDF rather than an image, convert the pages first and then threshold the results.
Mac
Drag from Finder or use the picker. Images captured with Continuity Camera from your iPhone can be dropped straight in.
iPhone and iPad
Photograph the page as flat and as evenly lit as you can, then tap the box and pick it from your Photo Library. For phone photos, Adaptive nearly always beats Auto.
Android
Pick the photo from Gallery or Files. If your scanning app already applied its own black and white filter, use Manual here so you do not threshold twice.
Questions people ask
What does thresholding an image mean?
It means replacing every pixel with either black or white, based on whether its brightness is above or below a chosen value. The result has only two tones and no grey.
Which mode should I choose?
Try Auto first. If parts of the picture go solid black or solid white while other parts look right, the lighting is uneven and Adaptive is the answer. Manual is for when you already know the exact value you want.
What is Otsu's method?
It is an automatic way to choose the cut-off. It tests every value and keeps the one that makes the dark group and the light group as distinct as possible. This tool shows you the value it picked underneath the controls.
Why does the tool tell me the threshold it chose?
So you can reproduce it. Once Auto shows you a number you like, switch to Manual, type that value in, and every image in a series will be thresholded identically instead of each one being measured separately.
What should the window radius be in Adaptive mode?
Roughly the size of the largest thing you want to stay solid, usually the biggest letter on the page. Too small hollows out thick strokes, too large behaves like a global threshold.
My scan comes out speckled with grey dots. What now?
Raise the bias slider. Speckle happens when the paper texture sits right at the local average, so nudging the decision toward paper removes it. A slightly larger radius also helps.
Will this improve OCR accuracy?
Often yes, because most OCR engines binarise internally anyway and a clean two tone page gives them less to guess about. It will not rescue a badly blurred or very low resolution photo, though.
Does the file get smaller?
Usually a lot smaller as a PNG, because an image with two values compresses extremely well. If your input was a JPG you will get a JPG back, and JPG is a poor fit for hard black and white edges, so PNG input is the better choice for documents.
Are my documents uploaded anywhere?
No. The image is decoded and processed by your own browser and the finished file is created on your device. Nothing is sent to a server at any point.
Can I do a whole folder of scans?
Yes. Add them all, choose the settings once, and press Apply. Each file is processed in turn and a Save all button appears when more than one is ready.
Is there any grey left in the output?
No. Every pixel is written as exactly 0 or exactly 255. If you save as JPG the compression itself can introduce faint grey at the edges, which is another reason to prefer PNG for this kind of image.
Your scan or photo is decoded and thresholded inside this page. It is never uploaded, which matters when the document is a contract, an ID or a medical form.
Last updated September 2026 · maintained by the FlipMyFormat team.