Skip to content

How to search for a word in a DjVu file on your computer

Updated October 23, 20268 min read

You need one term, one name or one quote in a book of five hundred pages. If the DjVu file has a text layer, finding it takes seconds. Here's how to search for text in a DjVu file on any computer, why some DjVu books can't be searched, and what you can do then.

Step 1

Open the book in the online DjVu viewer

Open our free online DjVu viewer in Chrome, Edge, Firefox or Safari, on Windows, Mac, Linux or a Chromebook. Drop the .djvu or .djv file on the page, or click Open a DjVu file and choose it. The book opens on your own computer: nothing is uploaded, there's nothing to install and no sign-up. If you don't have DjVu set up on your computer yet, see how to open DjVu on Windows or Mac. To try it on a real book, open the 1866 edition of Alice's Adventures in Wonderland from our free library: it has a text layer.

Step 2

Type a word in the search box, or press Ctrl+F

Click the Search in book box in the toolbar and type. While the book is open, Ctrl+F (or ⌘F on a Mac) puts you straight in that box instead of opening the browser's own find bar. Search starts as you type, from two letters (one is enough in Chinese, Japanese or Korean), and runs through the whole book. On a long book you'll see Searching… with a percentage while it reads the pages. On a narrow window or a phone, the search box sits behind the magnifying glass button.

Step 3

Jump from one result to the next

Results come in three places at once:

  • Results list: on a wide screen, a Results tab opens in the side panel, with each match in a line of its own text and its page number. Click a line to go to it. On a smaller screen, click the counter in the search box to open the list.
  • Counter: the box shows where you are, such as 3/27.
  • Next and previous: press Enter for the next match and Shift+Enter for the previous one, or use the Previous result and Next result arrows. After the last match, you go back to the first.
  • Highlights: every match is marked in yellow on the page, and the one you're on in orange.

Step 4

Copy the text you found

In a book with a text layer, you can select words right on the page with the mouse, as on a web page, and copy them with Ctrl+C (⌘C on a Mac). The text comes from the book's text layer, which was made by text recognition when the book was scanned, so check important quotes against the page image. To take the whole book's text, use DjVu to TXT, or DjVu to Word for an editable document.

How the search matches words

Search is forgiving, which helps with old books and inflected languages such as Russian:

  • Capital letters and accents don't matter: “cafe” finds “Café”, and “елка” finds “ёлка”.
  • Pre-1918 Russian spelling is matched: ѣ, і, ѳ and ѵ count as е, и, ф and и, so “вечный” finds “вѣчный”. A hard sign at the end of a word (“домъ”) doesn't stop a match for the word itself, but a phrase in modern spelling won't match a phrase full of them, so search old books one word at a time.
  • Parts of words match: “книг” finds “книга”, “книги” and “книгами”. Searching the stem catches every ending, but a short query also finds longer words that contain it.
  • Phrases work: type several words in a row; they are usually found even when they run across a line break.
  • A word split by a hyphen at the end of a line isn't found whole: search for its first or last part instead.
  • Very common words stop at 1,000 matches: the count shows 1000+. Add a word to narrow it down.

Why Ctrl+F in the browser finds nothing in a DjVu book

A browser's find bar searches the text of a web page. A DjVu page is drawn as a picture, so the words you see on it aren't web page text, and the find bar has nothing to look in. That's why Ctrl+F finds nothing when a DjVu page is shown on a website or in another viewer. The text you can search is a separate, hidden layer inside the file, and you need a DjVu viewer that reads it: in ours, Ctrl+F does exactly that while the book is open.

How to tell if a DjVu book has a text layer

Not every DjVu file can be searched. Only books that went through text recognition (OCR) when they were made carry a hidden text layer; many scans are pictures of pages and nothing more. Three quick checks:

  • Search in the viewer: if the book has no text, the viewer says This book has no text layer, so it can't be searched.
  • Try to select a word on the page with the mouse. If you can't, there's no text under it.
  • Search for a word you can see on a page. If it isn't found, that page may have no text, or its text was recognised with mistakes. Some books have text on most pages but not all, such as pages with plates or tables.

When the book has no text layer

Our web tools read the text layer that's already in the file: they don't run text recognition. A scan with no text layer stays pictures in the viewer, and converting it gives you no text either. Your options:

  • On iPhone or iPad: DjVu Reader recognises the text on scanned pages on the device itself and searches it. See how to search inside a scanned book.
  • Look for another copy: the same book is often shared in several scans, and some have a text layer. Every book in our library with searchable text says Text search: yes on its page.
  • Run OCR yourself: desktop text recognition software can add a text layer to a scan. It's more work, and old fonts and pre-1918 Russian spelling often come out with mistakes.

Search the book in any PDF reader

If you'd rather use the reader you already have, convert the book with DjVu to PDF, or click Convert to PDF in the viewer. When the DjVu has a text layer, its text goes into the PDF as invisible, searchable text in any language, so Ctrl+F works in your browser's PDF viewer, in Preview on a Mac and in most PDF readers and e-readers. Converting doesn't add text that isn't there: a scan without a text layer gives a PDF that can't be searched either.

Search many books at once

The viewer opens one book at a time. To look for a word across a whole shelf of books, turn them into text files first. Drop all the books on DjVu to TXT: each one becomes a plain UTF-8 text file in seconds, and with Page numbers on, a line like --- 12 --- marks where each page starts, so you can find the place again in the book. Then search the folder:

  • Windows: File Explorer's search finds words inside text files in indexed folders, which include Documents and the desktop by default.
  • Mac: search with Spotlight or in a Finder window.
  • Linux: use your file manager's content search, or grep in a terminal.
  • Any computer: open a text file in a text editor and use its Find.

Searching on iPhone and iPad

On a phone, the online viewer works too, but DjVu Reader for iPhone and iPad is made for it. Tap ••• › Search in Document, or press ⌘F with a keyboard on iPad. Searching books with a text layer is free. For scans without one, Search Scanned Pages (Pro) recognises the text on those pages on your device and searches them too, with nothing uploaded. More in how to search inside a scanned book.

Common questions

Does Ctrl+F work in a DjVu file?
In our online DjVu viewer, yes: while a book is open, Ctrl+F (⌘F on a Mac) opens the viewer's own search, which reads the book's text layer. The browser's find bar on its own can't search a DjVu page, because the page is a picture.
Why can't I search my DjVu file?
It most likely has no text layer: its pages are only pictures, so there's no text to search. The viewer tells you so. On iPhone and iPad, DjVu Reader can recognise the text on scanned pages and search it.
Does the online viewer run OCR on scanned DjVu books?
No. It searches and copies the text layer that's already in the file. For scans without one, use DjVu Reader on iPhone or iPad, which recognises text on the device, or look for another scan of the book that has text.
Can I search old Russian books printed before 1918?
Yes, if they have a text layer. Type in today's spelling: ѣ, і, ѳ and ѵ are matched as е, и, ф and и, so “вечный” finds “вѣчный”. Search one word at a time, since phrases in old spelling also carry hard signs at word ends.
How do I search for a word in several DjVu books at once?
Convert them with DjVu to TXT, then search the folder of text files with your computer's file search, or open them in a text editor. With Page numbers on, each match tells you which page it's on.

Open your first DjVu book.

Free on the App Store for iPhone and iPad.

More guides

All guides