All formats

FB2 (FictionBook 2)

Full nameFictionBook 2
Extensions.fb2; zipped: .fb2.zip, .fbz
MIME typeapplication/x-fictionbook+xml
Typee-book, reflowable; a single XML file with images embedded as Base64
Starts with<?xml (sometimes after a UTF-8 BOM), root element <FictionBook xmlns="http://www.gribuser.ru/xml/fictionbook/2.0">
SpecificationFictionBook 2.1 XML schema
Maintained bycommunity; schema published by Gribuser
Licenseopen, BSD-licensed schema

FictionBook 2 (FB2) stores a whole book in one XML file: metadata, the text marked up by structure (sections, titles, paragraphs, poems, epigraphs, notes) and the images as Base64 data. It describes what the text is, not how it looks: there is no layout or CSS, so every reader applies its own formatting. FB2 is the dominant e-book format in Russian-speaking countries and is widely supported by e-reader apps and devices (PocketBook, ONYX BOOX, KOReader, FBReader).

Because it’s plain XML with a fixed schema, FB2 is easy to generate, validate and convert. Large online libraries distribute books as .fb2.zip: a ZIP archive containing one .fb2 file, which cuts the size by 3 to 4 times.

When to use FB2#

File structure#

XML
<?xml version="1.0" encoding="UTF-8"?>
<FictionBook xmlns="http://www.gribuser.ru/xml/fictionbook/2.0"
             xmlns:l="http://www.w3.org/1999/xlink">
  <description>
    <title-info>
      <genre>sf</genre>
      <author><first-name>Jane</first-name><last-name>Doe</last-name></author>
      <book-title>My Book</book-title>
      <annotation><p>A short description.</p></annotation>
      <date value="2026-01-15">2026</date>
      <coverpage><image l:href="#cover.jpg"/></coverpage>
      <lang>en</lang>
      <sequence name="My Series" number="1"/>
    </title-info>
    <document-info>
      <author><nickname>converter</nickname></author>
      <program-used>My Tool 1.0</program-used>
      <date value="2026-01-15">2026-01-15</date>
      <id>6f1c2a3b-4d5e-4f60-8a7b-9c0d1e2f3a4b</id>
      <version>1.0</version>
    </document-info>
    <publish-info>
      <publisher>My Press</publisher>
      <year>2026</year>
      <isbn>978-0-00-000000-0</isbn>
    </publish-info>
  </description>
  <body>
    <title><p>My Book</p></title>
    <section>
      <title><p>Chapter 1</p></title>
      <epigraph><p>An epigraph.</p><text-author>Someone</text-author></epigraph>
      <p>First paragraph with <emphasis>italic</emphasis> and <strong>bold</strong> text.<a l:href="#n1" type="note">[1]</a></p>
      <empty-line/>
      <image l:href="#pic1.png"/>
    </section>
  </body>
  <body name="notes">
    <section id="n1"><title><p>1</p></title><p>The footnote text.</p></section>
  </body>
  <binary id="cover.jpg" content-type="image/jpeg">/9j/4AAQSkZJRgABAQ...</binary>
  <binary id="pic1.png" content-type="image/png">iVBORw0KGgoAAAANSUhEUg...</binary>
</FictionBook>

Top-level elements#

Element Count Purpose
stylesheet 0+ optional CSS-like styles for named style elements; most readers ignore it
description 1 metadata
body 1+ the main text; extra bodies with name="notes" or name="comments" hold footnotes and endnotes
binary 0+ Base64-encoded images (JPEG, PNG) with an id and content-type

description#

Element Purpose
title-info required: genre (one or more, from a fixed list such as sf, detective, prose_classic, nonf_biography), author, book-title, annotation, keywords, date, coverpage, lang, src-lang, translator, sequence (series name and number)
src-title-info the same fields for the original book, for translations
document-info required: who made this file, with which program, src-url, src-ocr, a unique id, version and history
publish-info the printed edition: book-name, publisher, city, year, isbn, sequence
custom-info free-form key/value data (info-type attribute)

An author has first-name, middle-name, last-name, nickname, home-page, email and id.

body content#

Element Meaning
section chapter or part; sections nest. Contains a title, epigraph, image, annotation, then text or child sections
title, subtitle headings; title holds one or more p
p paragraph
empty-line vertical space
poem, stanza, v poetry: stanzas of verse lines
cite, text-author quotation and its author
epigraph epigraph at the start of a section or the book
table, tr, th, td simple tables (FB2.1)
image picture referencing a binary by l:href="#id"

Inline markup: strong, emphasis, strikethrough, sub, sup, code, style (named style), and a l:href="..." for links; type="note" marks a footnote link to a section in the notes body.

Encoding and validation#

The XML declaration gives the encoding: modern files use UTF-8, but many older Russian files are in windows-1251, so a parser must honor the declaration instead of assuming UTF-8. The official schema (FictionBook.xsd with FictionBookGenres.xsd, FictionBookLinks.xsd, FictionBookLang.xsd) validates a file, but many files found online are not fully valid; robust readers parse leniently.

FB2.ZIP and FBZ#

.fb2.zip and .fbz are ordinary ZIP archives (usually DEFLATE) that contain a single .fb2 file. Readers that support FB2 generally open them directly. To process one, unzip it and read the .fb2 inside.

Converting#

Specifications and documentation#

Software that opens FB2 files#

SoftwareWindowsmacOSLinuxWebCanNotes
SumatraPDF✓viewfree, open source; .fb2, .fb2z, .fbz
Calibre✓✓✓view, convertfree, open source; converts FB2 to and from EPUB, AZW3, PDF
FBReader✓✓✓viewfree and paid versions; FB2 and FB2.ZIP. Also on Android and iOS
KOReader✓viewfree, open source; runs on Kindle, Kobo and PocketBook e-readers. Also on Android
Foliate✓viewfree, open source
Okular✓✓viewfree, open source document viewer
CoolReader✓✓viewfree, open source. Also on Android
Moon+ Readerviewfree with paid Pro version. Also on Android
ReadEraviewfree. Also on Android and iOS
PocketBook Readerviewfree; PocketBook e-readers open FB2 natively. Also on Android and iOS
FictionBook Editor✓view, edit, createfree, open source FB2 editor and validator
fb2cng✓✓✓convertfree, open source; FB2 to EPUB, KEPUB, AZW3, KFX

Libraries#

Open-source libraries that read and write FB2. See all FB2 libraries for a comparison.

C/C++MuPDF
C#Fb2.Document, FB2Library
PythonFB2, PyMuPDF
Rustfb2
PHPPHP eBook