Publicado
What FB2 Is, and Why Russian Ebook Libraries Run on It
FB2, short for FictionBook, is an XML ebook format built in Russia to describe a book's structure and metadata. Here is what it holds and how to read it.
FB2 is an ebook format that describes a book instead of drawing it
If a file ends in .fb2, you are holding a FictionBook: a whole ebook written as one XML document. It is rare outside the Russian-speaking world and common inside it, which is why it tends to surprise people who download a book and find nothing on their phone that opens it.
What FB2 is
FB2 is short for FictionBook 2. According to Wikipedia's FictionBook entry, it is an open, XML-based format that originated in Russia and was developed by Dmitry Gribov. FictionBook2 first appeared in 2004, and the latest release, version 2.21, is dated 16 January 2008. Nothing has changed since.
You will meet it in three forms. A plain .fb2 file is the raw XML. A compressed copy appears as .fb2.zip or .fbz. Readers that support FB2 generally accept the zipped version too, so you rarely need to unpack anything by hand.
Inside an FB2 file
Open an FB2 file in a text editor and you can read it. There is no archive of separate parts, which is the main difference from EPUB. As FileFormat.com's overview puts it, EPUB uses multiple files while FB2 keeps the complete book in one XML file.
The MobileRead wiki breaks that file into three parts:
- description: the metadata, covering genre, author, title, annotation, date, cover and language, plus a record of who produced the file and from what source.
- body: the text itself. The first body is the main text; further bodies can hold footnotes.
- binary: images, stored as base64-encoded text with an ID and a content type, and referenced from the text by that ID.
Base64 is why FB2 images need no separate files, and also why an uncompressed FB2 can be large. Zipping it recovers much of that size.
Structure over layout
FB2 records what each piece of text is, not how it should look. There are dedicated tags for epigraphs, verses, quotations and subtitles, and section titles generate the table of contents. A stylesheet element exists, but MobileRead notes it is often unused because reading programs apply their own defaults.
It is the same idea behind any reflowable file: the book has no fixed page, so the reader chooses the font, size and margins. FB2 simply goes further than most formats in leaving appearance out. The trade-off is little design control. Links, for instance, are restricted to images and notes, so FB2 suits novels far better than a textbook with a complicated layout.
Why Russian libraries use it
Structure plus embedded metadata is exactly what a catalog wants. Wikipedia notes that because the author, title and publisher live inside the file, the format suits automated processing, indexing and collection management. A library can read those fields instead of guessing from a filename, which matters when you are cataloging thousands of books. If you have ever wondered what metadata lives inside your ebook, FB2 is a format where that answer is unusually complete.
The community matters just as much. MobileRead says the specification is maintained by a close-knit group of Russian e-library operators, and that three of the four largest Russian e-text libraries it names (Fictionbook library, Aldebaran and BookZ) use the format extensively. The format was built by the people running those collections, and an open XML format was easy for them to produce and convert.
There is a successor on paper. FictionBook3 (FB3) would use an EPUB-like folder structure and drop base64 images. Wikipedia reports that its beta specification, dated October 2008, hasn't been updated and that no popular reader supports it. The retailer LitRes, which originally used FB2, has mostly moved to its own FB3 since about 2016, according to MobileRead.
Opening FB2 files
Plenty of readers handle FB2: FBReader, CoolReader, AlReader, STDU Viewer and Okular, and every PocketBook device. Kindle, Nook and Sony devices do not support it directly. If your reader is a Kindle, you will need a conversion step, much like the one that comes up with MOBI and AZW files in the other direction.
Calibre converts to and from FB2, and Pandoc does as well. EPUB is the usual target. One caution from MobileRead: Calibre loses internal links when it creates FB2, so check footnotes after converting that direction.
Margina reads PDF, EPUB, Word, plain text and Markdown rather than FB2, so an FB2 book needs to become an EPUB first. Once it is, you can send it to your phone like any other file and open it in Margina on iPhone or Android, with no account involved.
What to take from this
FB2 is a library format at heart: one readable file, rich metadata, almost no opinion about appearance. That makes it durable and easy to convert, and it also explains why it never spread past the communities that built it. For its siblings in the long tail, see DjVu, CBZ and other document formats.
Frequently Asked Questions
Can a Kindle open FB2 files?
Not directly. Kindle devices do not support FB2, so the file needs converting to a format the Kindle accepts, for example with Calibre.
What is the difference between .fb2 and .fb2.zip?
Nothing about the book. A .fb2.zip is the same XML file compressed in a ZIP archive, which shrinks the text and base64 images. Readers that support FB2 also accept the zipped copy.
Is FB2 better than EPUB?
Neither is better in general. FB2 is simpler: one XML file with detailed built-in metadata. EPUB has far wider device support and more control over layout.
What is FB3?
A proposed successor that uses an EPUB-like directory structure and drops base64 images. Its beta specification hasn't been updated since 2008, and no popular reader supports it.