.opf

What is a .opf file?

Open Packaging Format · eBook · International Digital Publishing Forum · 1999

An .opf file is the package document inside an EPUB eBook. It is an XML manifest that lists every file in the book, the reading order and the metadata (title, author, language).

Category
eBook
Type
Plain text
Is a .opf file safe to open? Safe. An OPF is an XML manifest. It lists files and metadata, and does not execute.

What is a .opf file used for?

Unzip an EPUB and you find an .opf: it is the table of contents for the package, telling a reader which files exist, in what order to read them, and what the book is called. It does not contain the text itself.

You rarely open an .opf on its own; it is part of an EPUB. Calibre also uses standalone .opf files to store a book's metadata alongside it.

What opens a .opf file?

The .opf format opens in the following apps, grouped by operating system. If one app does not work, try another from the same list.

Windows

  • Calibre
  • Sigil
  • any text editor

macOS

  • Calibre
  • Sigil
  • any text editor

Linux

  • Calibre
  • Sigil
  • any text editor

Open a .opf file step by step

  1. Confirm the file really is a .opf. Drop it into the WhatFileType identifier, which reads its signature in your browser without uploading anything.
  2. On Windows, open it with Calibre or Sigil.
  3. On Mac, use Calibre or Sigil.
  4. On Linux, try Calibre or Sigil.
  5. Still stuck? Convert the .opf to xml, which opens more widely.

Why can't I open my .opf file?

Almost always because no installed app understands OPF. Install one of the apps above, or convert the file to a format your existing software already reads. If double-clicking opens the wrong program instead of nothing at all, the file association is set to the wrong app rather than the file being broken.

The other possibility is that the file is not really a .opf at all. Drop it into the file identifier to check it by its bytes instead of its name. Nothing is uploaded.

How to convert a .opf file

You can convert a .opf file to xml using a conversion tool or the export menu of an app that opens it.

What is the .opf file signature (magic bytes)?

A .opf file starts with the hex bytes 3C 3F 78 6D 6C, which read as <?xml in ASCII. Programs identify OPF by those bytes, not by the filename, so a renamed file still gives itself away.

These are the documented signatures for OPF. For a full breakdown, see the XML file signature page.

Documented magic-byte signatures for the .opf format
Hex signatureOffsetASCIINote
3C 3F 78 6D 6C0<?xml'<?xml' (OPF is XML)

See the full magic-numbers reference for every format.

Frequently asked questions

What is a .opf file?

An .opf file is the package document inside an EPUB eBook. It is an XML manifest that lists every file in the book, the reading order and the metadata (title, author, language).

What is an .opf file?

The package manifest inside an EPUB: an XML file listing the book's contents, reading order and metadata. It is the index, not the text.

How do I open an .opf file?

Any text editor shows the XML. In practice it lives inside an EPUB, which you open in Calibre or Sigil.

Why does Calibre create .opf files?

Calibre stores each book's metadata in a companion metadata.opf so it can rebuild its library, keeping title, author and cover details alongside the book.

Related formats

Sources

Details on this page were checked against authoritative references. How sources are ranked and what is deliberately left out is set out in the methodology.