Skip to content

What is a DjVu file?

DjVu, pronounced “déjà vu” and written .djvu, is a document format designed for one job: storing scanned pages at high quality without the file size a scan normally costs. It was developed at AT&T Labs in the mid-1990s and is still the format of choice for digitized books, academic journals, technical manuals, and library archives.

If you have run into a .djvu file, it almost certainly came from a scanned book.

Why DjVu files are so much smaller than scans

Section titled “Why DjVu files are so much smaller than scans”

An ordinary scan is one big photograph of a page, and photographs of text compress badly. DjVu’s insight was that a scanned page is not one image but three things layered together:

  • A text layer - the sharp black marks that make up the letters.
  • A background layer - the paper, its color, its stains and shadows.
  • A foreground layer - the ink color of the text.

The text mask is stored at full resolution because that is what your eye reads. The background and foreground are stored at much lower resolution, because blurry paper still looks like paper. On top of that, DjVu finds shapes that repeat across the document - every lowercase “e” in a book is nearly identical - and stores each shape once, referencing it everywhere it appears.

The result is that a 300-page scanned book that would be 100 MB or more as a PDF of page images often lands somewhere between 5 and 20 MB as DjVu, with the text looking sharper rather than worse.

A .djvu file holds the page images and, often but not always, a hidden text layer produced when the document was originally scanned and run through OCR. When that layer is present you can search and select text. When it is missing - which is common for older scans - the pages are pictures only, and you need to recognize the text yourself before search will find anything.

Some DjVu files also carry an outline (a table of contents), page numbering, and embedded annotations.

DjVu is not built into macOS, Windows, iOS, or Android, and browsers do not render it, so you need an app that reads the format.

On Apple platforms, Niraqua DjVu opens .djvu documents natively on Mac, iPhone, and iPad. It reads the embedded text layer when a file has one, and when a file does not, its on-device text recognition creates one so the scan becomes searchable. Everything happens on your device - no upload, no account.

See how to open a DjVu file on a Mac for the step by step, or reading DjVu on iPhone and iPad for the touch version.

Often, yes - not because DjVu is worse, but because PDF is what everything else accepts. If you need to email a chapter to someone, submit a scan, annotate it in another app, or simply be certain it will open on any machine in ten years, PDF is the safer container.

Converting also lets you keep the searchable text: exporting with a text layer means the PDF is searchable in Preview, Acrobat, or anything else. See converting DjVu to PDF, or DjVu vs PDF for which format to keep a document in.

Is DjVu still maintained? The format specification is stable and open, and the reference implementation (DjVuLibre) is still developed. New documents are rarely produced in DjVu today, but the enormous existing archives are not going anywhere.

Can I edit a DjVu file? Not in the way you edit a text document - the pages are scans. Niraqua DjVu reads, searches, and exports them rather than rewriting their contents.

Is DjVu safe to open? A .djvu file is a document, not a program. Opening one in a reader that only decodes documents carries the same risk as opening any image file.