How to extract text from an image
- Drop a picture into the box above, click it to choose one, or paste with Ctrl+VTap the box above to choose a picture, or tap Take a photo to shoot one. JPG, PNG, WebP, HEIC and AVIF can be opened.
- Check Language of the text. It starts with the language of this page plus English words and numbers; change it for Japanese, vertical Japanese or English. Under Language data you can see what has to be downloaded the first time and how large it is.
- Press Extract text. The first time, a progress bar shows the language data downloading (1 to 2 MB per language); after that the reader starts at once. A phone photo usually takes a few seconds.
- Read the result in the text box and fix mistakes right there. Turn on Show the recognised lines on the picture to see where each line was found; lines the reader is unsure about are drawn in red.
- Press Copy to put the text on the clipboard, or Download .txt to save it as a file.
What we measured
We drew our own test pictures and read them with this page, counting the characters that came out right. They are cleaner than many real photos, so treat the figures as the good case, not a promise.
| Picture | Language setting | Characters right | Time |
|---|---|---|---|
| Screenshot of Korean text (700 × 300 px) | Korean + English | 95.2% | 1.4 s |
| Same screenshot in dark mode | Korean + English | 91.2% | 2.0 s |
| Phone-style photo of a printed Japanese page (1800 × 2400 px) | Japanese + English | 97.7% | 3.7 s |
| The same kind of photo with a strong shadow, lighting fix on | Japanese + English | 96.9% | 3.3 s |
| The shadowed photo with the lighting fix off | Japanese + English | 11.6% | 4.5 s |
| Vertical Japanese text (900 × 700 px) | Japanese, vertical | 96.8% | 2.6 s |
| English receipt (460 × 760 px) | English | 100% | 2.1 s |
Times include starting the reader, with the language data already on the device. The first reading adds the one-time download of 1 to 3 MB. Handwriting, tables and dim photos were not part of this test, and they read worse.
The shadow test shows why Even out lighting and contrast exists: the reader alone almost gave up on a page that was dark on one side, and read it nearly perfectly once the light was evened out. On clean screenshots the setting changes little.
Which language to choose
| Setting | Use it for | Downloaded the first time |
|---|---|---|
| Korean | Hangul text; with English words and numbers added by default | 1.1 MB |
| Japanese | Horizontal Japanese: kanji, hiragana, katakana | 1.5 MB |
| Japanese, vertical | Columns of vertical text, read right to left | 2.0 MB |
| English | English and other text in the Latin alphabet | 1.9 MB |
Sizes are for the compressed files served by this site. Each language is downloaded only if you use it. Chinese is not supported.
Good to know
- Hold the camera square to the page, in even light, with the text filling most of the frame. A tilted or shadowed shot reads noticeably worse than a flat, bright one.
- The reader cannot read text that lies on its side or upside down. If a photo is sideways, turn it upright first with Crop image, then read it.
- Crop to the part you need. Logos, borders, photos and stamps around the text only add stray characters, and a smaller picture is read faster.
- Leave Even out lighting and contrast on for photos of paper and for dark-mode screenshots. If a clean, white screenshot reads slightly worse with it, turn it off.
- Check numbers, names and amounts against the picture, because those are the mistakes that matter. Confusions such as 0 and O, or 1 and l, are the most common.
- Pick the language that matches the text. Korean text read as Japanese, or the other way round, comes out as nonsense characters.
How the text is read
The reading engine
The text is read by Tesseract, an open-source recognition engine, in its tesseract.js build that runs as WebAssembly in the browser. The language models are the “fast” models of the tessdata_fast project, which trade a little accuracy for a much smaller download. Tesseract, tesseract.js and tessdata_fast are all published under the Apache License 2.0. Before reading, the picture is turned to greyscale and enlarged if it is small. Everything else, such as the language choice and the editing, happens on this page.
Frequently asked questions
Is my file uploaded to a server?
No. The text reader runs inside this browser tab as WebAssembly. Its code and its language data are served from hanji.page itself, not from any other company’s server, and the picture or PDF you open is never sent anywhere. After the first use the language data is stored on your device, so once the page has loaded you can even switch to airplane mode and it keeps working.
How accurate is it?
It depends on the picture far more than on the language. On our own test pictures, a Korean screenshot, a photo of a printed Japanese page and an English receipt, between 91 and 100 percent of the characters came out right; the measured figures are in the section above. Clear printed text in a screenshot or a sharp photo is read very well. Blur, shadow, low light and tiny text bring the accuracy down quickly, so check anything important.
Can it read handwriting, tables or photos taken in low light?
Printed text, yes; the others only partly. Handwriting is mostly not recognised, except very neat block letters. A table is read line by line, so columns end up side by side or mixed in reading order, without cells or borders. Photos taken in dim light, out of focus, on a curved page or at a steep angle give many mistakes; Even out lighting helps with shadows but cannot restore detail that the camera never captured. Decorative fonts, text smaller than about 20 pixels tall and text on busy backgrounds are also hard.
What is downloaded the first time, and is it kept?
The reader itself (the engine, a few MB) and one language file for each language you use: Korean 1.1 MB, Japanese 1.5 MB, English 1.9 MB and vertical Japanese 2.0 MB. The page shows the exact size and a progress bar before and during the download. The files are stored in your browser’s own storage (IndexedDB), so the next reading starts at once. Clearing this site’s data in the browser removes them, and they are downloaded again when needed. HEIC photos additionally load a decoder of about 3 MB, only when you open one.
Can it read vertical Japanese?
Yes. Choose Japanese, vertical and read a picture of a single block of vertical lines, which are read from right to left. It works best when you crop the picture to that block. A page that mixes horizontal and vertical text, or vertical text with English words in it, is not handled well; read each part separately.
Does it work on a phone, and can it read photos straight from the camera?
Yes. On a phone the page offers a Take a photo button that opens the camera, and a photo from the gallery works as well, including iPhone HEIC. A photo is scaled so that its longest side is at most 3,200 pixels before it is read, which is plenty for text and keeps a phone from running out of memory. Reading a page of text usually takes a few seconds, a little longer on older phones.
Guides that explain this
- Why Text Extraction From Photos Goes Wrong, and How to Fix ItHow text size, blur, tilt, shadows, JPG quality and the wrong language setting change OCR accuracy, measured on the same engine Hanji uses.
Related tools
Found a bug, or wish this tool did something more? Tell Leo, who runs Hanji. Send feedback