Best Image Format for OCR — PNG vs JPG vs WebP Compared
Short answer: PNG is usually best, JPG is the usual culprit when text comes out wrong, and WebP sits in between. The format matters because text recognition reads edges, and different formats damage edges in different ways.
This page explains what each format does to letterforms, with the settings that actually change the outcome.
OCR reads edges, not file names
A letter is a shape defined by where ink stops and paper begins. Every image format either preserves that boundary exactly or smears it, and nothing else about the format — file size, colour depth, metadata — matters to a text reader.
That single fact explains almost every surprising result:
- Two files that look identical on screen can read completely differently, because one has clean edges and the other has faint halos around them.
- A smaller file is often a worse file, because the size came from throwing away edge detail.
- Re-saving a JPG as PNG does not help at all, because nothing that was already discarded comes back.
PNG: the usual best case
PNG is lossless. The pixels you saved are the pixels the reader gets, which makes it the most reliable input for text.
Best for: screenshots, UI text, code, exported diagrams, anything drawn by software.
The one PNG trap: transparency. A PNG with a transparent background has no background at all, and if that is drawn naively it becomes black — turning dark text on nothing into dark text on black. This site flattens transparency onto white before reading, which is the step that makes transparent screenshots work.
When PNG is not the answer: a photo saved as PNG. It is lossless but it is still a photo — shadows, tilt and sensor noise do not go away.
JPG: small files, softer type
JPG compresses by discarding detail near edges, on the assumption that eyes will not miss it. Eyes usually will not. A text reader will, because edges are the entire signal it works from.
The damage looks like faint rings and blocky patches hugging each letter. Human vision ignores them; the reader treats them as strokes and starts inventing lines inside letters like e, a and 8.
When JPG is fine: quality 85 or above, reasonable resolution, and the text is not the smallest thing in the frame. A 300 dpi scan saved as JPG reads very well.
When JPG breaks: quality below 60, images under about 800 pixels wide, and anything that has been through a messaging app. WhatsApp and WeChat recompress aggressively — often to a third of the original dimensions — and that is usually fatal.
The fix this site applies: small JPGs are upscaled to about 1400 pixels wide and given a mild unsharp mask before reading. That recovers most of what compression took away on document photos and screenshots exported as JPG. It cannot recover a file that a chat app already destroyed.
WebP: convenient, sometimes lossy
WebP is what many sites now serve because it is smaller than JPG at similar quality. It has both lossy and lossless modes, and you usually cannot tell which one you have.
Best for: images saved straight from a modern website at full quality.
The problem: a lossy WebP has the same edge damage as JPG, and WebP images are often served at reduced dimensions for page speed — two kinds of quality loss stacked on top of each other.
What to do: if a WebP reads badly, ask the site for the original or screenshot it instead. A screenshot of the displayed image is often better than the served file, because the screenshot has no additional compression.
Both modes are handled on the WebP to text page — transparency is flattened onto white, and images under 1400 pixels wide are sharpened before reading, which is where lossy WebP does the most damage.
HEIC: excellent quality, uneven support
Apple's default since iOS 11. A HEIC is a HEIF container holding an HEVC-coded image, which is roughly half the size of the equivalent JPG at the same visual quality. For text recognition the quality is good — HEIC is far more efficient than JPG, not more lossy — so a properly shot HEIC photo reads well.
The problem is not quality, it is decoding. Safari on iPhone, iPad and macOS reads HEIC natively. Chrome, Edge on Windows and Firefox do not, and they fail without naming the format, which is why the same file opens on your phone and shows as a broken image on a laptop.
What to do: on a Mac, export once to PNG in Preview — that is lossless, so no text quality is lost. On Windows, install the HEIF Image Extension so Photos can open it, then save a PNG copy. Or skip conversion entirely and use Live Text on the phone. The HEIC to text page goes through all three routes, and is honest about which browsers it works in.
GIF and BMP: rare, but not terrible
GIF is limited to 256 colours, which sounds like it should ruin text — but for a black-text-on-white-background screenshot, 256 colours is plenty. A GIF screenshot of a text UI usually reads fine. What breaks it is dithering on gradients.
BMP is uncompressed, so quality is perfect and file size is huge. Rare in practice; when you see one, it reads well.
PDF: not an image format, but often the source
A PDF is either a document with real text in it, or a container of photographs. Test which by trying to select a word in your PDF reader:
- It highlights → the PDF has text. Copy it. Do not run OCR; extraction from the file is exact.
- Nothing highlights → it is a scan. Use the scanned PDF tool, which renders each page and reads it.
Resolution matters more than format
This is the part people skip, and it decides more outcomes than the format choice does.
The reader needs roughly 20 pixels of height per character to be comfortable, and degrades sharply below about 12. A perfect PNG at 8 pixels per character reads worse than a mediocre JPG at 30.
Practical translations:
- A 300 dpi scan of a page: excellent.
- A 150 dpi scan: good.
- A 100 dpi scan: marginal, expect errors.
- A screenshot at 100 % zoom of 14 px UI text: fine.
- The same screenshot at 100 % zoom of 11 px text: unreliable — zoom in to 150 % first.
- A phone photo where the page fills the frame: fine.
- A phone photo where the page occupies a quarter of the frame: too small, crop it.
A simple decision list
| You have | Do this |
|---|---|
| A screenshot | Use it as is. PNG is ideal, JPG still works. |
| A JPG under ~1000 px wide | Re-export at full size if you can. Otherwise this site upscales it. |
| An image from a chat app | Ask for the original file. The forwarded copy is usually beyond saving. |
| A photo of paper | Format barely matters. Light and angle matter enormously — shoot straight down, evenly lit. |
| A PNG with transparency | Use it directly; transparency is flattened onto white automatically. |
| A WebP saved from a website | Also fine — the WebP tool handles both lossy and lossless. |
| A HEIC from an iPhone | Read it in Safari, or export to PNG once. Chrome cannot decode HEIC at all — see HEIC to text. |
| A PDF you can select text in | Copy the text. Do not OCR it. |
| A PDF you cannot select text in | Use the scanned PDF tool. |
| Text smaller than 12 px on screen | Zoom to 150 % and screenshot again. |
Why this matters less than you think
Format is the third most important thing about an image, behind resolution and lighting. If a conversion came out badly, changing format is unlikely to fix it — cropping closer, shooting straighter, or re-exporting from the original source will.
The one exception is the JPG-from-a-chat-app case, which is common enough to be worth repeating: recompression by a messaging app destroys more text detail than any format choice you could make.
The related guide on why OCR comes out messy goes through the failures that are not about format at all.