How to extract text from a PDF
- Drop a PDF into the box above or click it to choose oneTap the box above to choose a PDF. It is opened on your device.
- Read the summary under the file name. It says how many pages contain text and lists the pages that do not, which are most likely scans or photos.
- The text of every page that has it appears in the box at once, each page behind a marker line such as “--- Page 1 ---”. Turn Mark each page off if you want the text without the markers.
- If some pages are scans, choose their Language of the text and press Recognise scanned pages (OCR). A progress bar counts the pages, you can press Stop at any time, and the pages read so far stay in the text.
- Fix anything in the box if you like, then press Copy or Download .txt.
Text layer or scan: what to expect
| Kind of PDF | How the text is taken | Result |
|---|---|---|
| Saved from Word, a web page or a design tool | Copied from the text layer | Exact characters, instantly, in the order stored in the file |
| Scan or phone photos with no text layer | Each page is drawn at 200 dpi and read with OCR | A few seconds per page; mistakes are possible |
| Scan with an invisible text layer from a scanner app | Copied from the text layer | As good as the scanner app’s own recognition |
In our test, a scanned page of Korean text drawn at 200 dpi was read with 96.0% of its characters right in about 1.9 seconds, with the language data already on the device. A scanned English receipt page took about 2.4 seconds. These were clean test pages, so real scans may do worse.
Good to know
- A PDF with a text layer gives you the exact characters, with no recognition mistakes. Only pages without a text layer need OCR.
- Text comes out in the order it is stored in the file. Pages with several columns, sidebars, headers and footers can come out mixed; a table becomes a run of lines without cells.
- If the extracted text is garbled although the page looks fine, the PDF carries a broken text layer. Switch on Read every page as a picture to use OCR for all pages instead.
- Long scans take a while: reading every page as a picture is a matter of seconds per page. Split a long PDF into parts first (Split PDF) if you only need some of it.
- For a password-protected PDF, remove the password in a PDF reader, save a copy and open that copy here.
- To work on the text in Word or a notes app, turn the page markers off and paste the text in.
How the text is read
Text layer and scans
Most PDFs keep their words as text, each with a position on the page, which is called the text layer. This tool reads that layer page by page with pdf.js, the PDF library of the Firefox browser, so the result is the exact text of the file. A scanned PDF has no text layer, only a picture of each page. For those pages the tool draws the page at 200 dpi and reads it with Tesseract, an open-source OCR engine that runs in your browser, the same one used by Image to text.
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.
Why do some pages have no text?
A PDF can hold a page as text, or as a picture of a page. Documents saved from Word or a web page keep their text. A scan from a copier or a scanner app, or a PDF made from phone photos, holds only pictures, so there is nothing to copy. This tool lists such pages and can read them as pictures with OCR. Some scanner apps already add an invisible text layer after their own recognition; those pages count as having text.
How good is the text read from scanned pages?
Each scanned page is drawn at 200 dpi and read with the same engine as the Image to text tool, so the same limits apply: clean printed text is read very well, while handwriting, tables, faint copies and tiny print give mistakes. The measured accuracy and the time per page are in the section above. Always check numbers, names and dates against the page.
The extracted text is garbled or full of strange symbols. Why?
Some PDFs, mostly older Korean and Japanese documents and some exports from design software, store their letters with custom codes and no Unicode table. A viewer shows them correctly, but copying them gives wrong characters, and so does this tool. Turn on Read every page as a picture: the page is then drawn and read with OCR, which ignores the broken text layer.
Does it keep the layout, tables and images?
No, the result is plain text. Images are skipped. The text follows the order stored in the file, so headings, columns, tables, headers and footers appear one after another rather than where they sit on the page. If you need the pages as pictures, use PDF to JPG instead.
Is there a limit on the number of pages?
No fixed limit. Text is taken from the file page by page, which is fast even for hundreds of pages. Reading scanned pages with OCR takes a few seconds each, so a long scan takes minutes and uses more memory; split it into parts if your phone struggles.
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