OCR accuracy is decided long before the engine runs — it is decided when you capture or save the image. The right format and resolution give the recogniser crisp, clean character edges to work with; the wrong ones smear those edges into mush. This guide explains which format to use, what resolution to aim for, and how to capture images that OCR reads accurately the first time.
PNG vs. JPG: which format is better for OCR?
The short answer: PNG for screenshots and synthetic images, clean JPG for photographs, and avoid heavily compressed files of any kind.
The reason comes down to how each format stores detail. PNG is lossless — it preserves every pixel exactly, including the sharp boundaries between dark text and a light background. That makes it ideal for screenshots, exported documents, and any image generated by software, where text edges are already crisp and you don't want compression softening them.
JPG is lossy. It throws away detail to shrink the file, and the detail it sacrifices first is exactly the high‑contrast edges that OCR depends on. At high quality, a JPG photo of a page is perfectly readable. At low quality, compression artifacts cluster around letters — those faint blocky halos — and the engine starts confusing characters. So JPG is fine for camera photos saved at good quality, but a bad choice for screenshots, where PNG is strictly better.
If you already have a JPG screenshot that looks soft, converting it won't restore lost detail, but capturing fresh as PNG will. When you need to move a photo into a lossless container for editing before OCR, our JPG to PNG tool handles that conversion. Either way, the engine behind our image to text converter accepts both formats, so you can simply upload and compare.
What about HEIC, WebP, TIFF, and PDF?
- HEIC (iPhone photos) reads fine in most tools, but it is not universal; convert to JPG if a program rejects it.
- WebP is common from the web and works, though support is less consistent than JPG or PNG.
- TIFF is the traditional archival scan format and is excellent for OCR because it is typically uncompressed.
- PDF is a container, not an image. For scanned PDFs, OCR happens on the page images inside — use a dedicated PDF flow rather than treating it as one picture.
Resolution and DPI: how sharp is sharp enough?
Format protects the detail; resolution provides it. The widely cited sweet spot for document OCR is 300 DPI (dots per inch). That gives each character enough pixels for the engine to distinguish its shape without ballooning the file. Below roughly 200 DPI, small text starts to break down; going much above 400–600 DPI rarely helps and just makes files larger.
For phone photos, DPI is less meaningful than how much of the frame the text fills. A practical rule: the smallest text you care about should be at least 20 pixels tall. If a lowercase letter is only a handful of pixels high, no engine can reliably read it. Fill the frame with the text, hold the camera close, and crop away empty space.
A common mistake is up‑scaling a small image hoping to "add resolution." Enlarging doesn't create detail that wasn't captured — it just stretches the blur. Capture at high resolution from the start instead. For salvaging images that are already too small or soft, our guide on OCR for blurry or low‑quality images covers the realistic options.
Colour, contrast, and compression
Beyond format and resolution, a few capture choices have outsized effects:
- Maximise contrast. OCR thrives on dark text against a light, even background. Grey‑on‑grey or coloured text on a busy background is the hardest case.
- Even lighting. Glare and shadows across a photographed page confuse the engine as much as low resolution does.
- Skip aggressive compression. A 50 KB JPG of a full page will have visible artifacts; give it room to breathe.
- Colour isn't required. Clean grayscale or black‑and‑white scans often OCR as well as colour, sometimes better, because there is less noise.
These factors compound. A 300 DPI, high‑contrast, well‑lit PNG is a near‑ideal input; a low‑resolution, dim, heavily compressed JPG is the opposite. For the full checklist of capture and prep habits, see our guides on improving OCR accuracy and preprocessing images for OCR.
A quick capture checklist
Before you run OCR, aim for:
- PNG for screenshots and screen content; high‑quality JPG or TIFF for photos and scans.
- 300 DPI for scanned documents, or text that fills the frame for phone photos.
- Small text at least ~20 pixels tall.
- High contrast — dark text, light background.
- Even lighting, no glare, no skew.
Hit those and most clean printed text comes back nearly perfect. Then upload to our image to text tool and review the result.
Frequently asked questions
Is PNG or JPG better for OCR?
PNG is better for screenshots and any software‑generated image because it is lossless and keeps text edges sharp. High‑quality JPG is fine for camera photos. Avoid low‑quality JPGs, whose compression artifacts cluster around letters and cause misreads. Our image to text tool accepts both.
What DPI should I scan documents at for OCR?
300 DPI is the standard sweet spot — enough detail for reliable recognition without oversized files. Going below ~200 DPI hurts small text, while much above 400–600 DPI rarely improves accuracy.
Will converting a blurry JPG to PNG improve OCR?
No. Converting formats can't restore detail that lossy compression already discarded. PNG helps only when you capture fresh in PNG. To move a photo into a lossless format for editing first, use our JPG to PNG tool, then OCR it.
Does resolution matter more than format?
They work together. Resolution provides the detail; format determines whether that detail survives saving. A high‑resolution image saved as a low‑quality JPG can still OCR poorly, so get both right.
Capture clean, then convert with confidence — upload your best‑quality image to our free image to text tool and see how much format and resolution improve the result.