FictionBook 2 MIME Type

Learn what application/x-fictionbook+xml identifies, how FB2 ebooks are structured, which readers open them, and how Poly previews and indexes them.

MIME type details for application/x-fictionbook+xml

In active use
MIME typeapplication/x-fictionbook+xml
Extensions
.fb2
First standardized2004
Created byDmitry Gribov and the FictionBook project
Browser support
Example applicationsFBReader, calibre
Poly supportYes. Poly recognizes .fb2 files and converts them to PDF. Malformed books may fail conversion.
Indexed by PolyYes. After conversion, Poly indexes page text, OCR fallback, and page-level visual similarity. It does not expose the original XML structure as an index.
Preview in PolyYes. Poly opens a paginated PDF representation, not a native reflowable FictionBook reader.
Poly agentYes. The Poly agent can read the converted book's page text and rendered pages after conversion succeeds.

What does application/x-fictionbook+xml mean?

The application/x-fictionbook+xml media type identifies a FictionBook 2 ebook, normally stored with the .fb2 extension. An FB2 file is one XML document. It describes a book's structure and meaning with dedicated elements for metadata, sections, paragraphs, poems, quotations, notes, links, and images.1

That structure is different from a page-layout format. An FB2 book does not define fixed paper-sized pages, so a reader can choose fonts, margins, colors, and pagination for its screen. Images and other presentation data can still travel inside the same XML document as Base64-encoded binary elements.1

The media type is a well-established implementation convention, but it is not registered with IANA. The current IANA application registry does not list a FictionBook subtype.2 The historical x- prefix is therefore important: it distinguishes this conventional identifier from a standards-tree registration.

How can you identify an FB2 file?

The usual extension is .fb2. There is no fixed byte signature because XML declarations can vary in length and encoding, comments or whitespace may appear near the start, and a byte-order mark may be present. A more reliable content check looks for a well-formed XML document whose root is FictionBook in this namespace:

http://www.gribuser.ru/xml/fictionbook/2.0

The FictionBook schema defines that namespace, the FictionBook root, a description block, the main body, an optional notes body, and optional embedded binary data.1

Do not identify an FB2 book from the generic <?xml opening alone. Many unrelated formats are XML. Check the root element and FictionBook namespace, then validate against the complete schema when correctness matters.

Where FictionBook 2 came from

Dmitry Gribov's FictionBook 2 schema dates to 2004. Its design treats an ebook as structured text rather than a sequence of finished pages. The schema records information about both the work and the particular XML document, including authors, title, language, document creator, creation date, source URL, identifier, version, publication details, and revision history.1

That semantic model is especially useful for novels, poetry, and other text-led books. Sections can nest into chapters, poems have explicit stanza and verse elements, and secondary bodies can hold notes reached through links. A reading application supplies the final typography.

FictionBook remains outside the IANA media-type standards process, but application support is active. FBReader lists raw fb2 and compressed fb2.zip books as supported on desktop, Android, and iOS.3 calibre also maintains dedicated FB2 input and output conversion paths.4

How to open an .fb2 file

Use an ebook reader rather than expecting a normal browser tab to provide a book interface. A browser may show the XML as text or an XML tree, but it does not natively turn FictionBook sections and metadata into a reflowable reading experience.

Practical choices include:

  • FBReader, which supports FB2 across its desktop and mobile versions.3
  • calibre, which can view and convert ebooks on Windows, macOS, and Linux.4
  • A dedicated ereader or mobile app whose format list explicitly includes FB2.

If an application reports invalid XML, inspect the encoding declaration and validate the document against the FictionBook schemas. Renaming another ebook to .fb2 does not convert its contents.

Support in Poly

Poly maps application/x-fictionbook+xml and .fb2 filenames to its FictionBook document type. The document loader sends the original book to calibre's ebook-convert and stores the resulting PDF representation. Poly then runs that PDF through its normal page pipeline.

Repository tests exercise an FB2 fixture and verify that conversion produces a PDF, five thumbnail sizes, extracted full text, a file embedding, and page embeddings. After successful conversion, Poly therefore provides:

  • A thumbnail and rendered page thumbnails.
  • A paginated preview in the PDF viewer.
  • Page text extraction, with OCR fallback for rendered content when needed.
  • Filename, full-text, semantic, and page-level visual search.
  • Page text and rendered content that the Poly agent can read.

The converted preview is not a native FB2 reader. It freezes one rendering into pages and does not expose the source XML, let you change reader typography, or preserve reflow as an interactive feature. A malformed book or a calibre conversion failure prevents those page-level features from being created. Poly's general document limits also apply: files over 1 GiB are not processed, and indexing covers at most 1,024 converted pages.

Open the original .fb2 in a dedicated reader when responsive typography or exact FictionBook behavior matters. Poly's PDF representation is designed for consistent preview, search, and agent access.

FB2 compared with EPUB

FB2 and EPUB both support reflowable ebooks, but their packaging and content models differ:

PropertyFB2EPUB
Main representationOne XML documentZIP package of XHTML or SVG, CSS, metadata, and resources
ImagesBase64 data inside binary elementsSeparate resources inside the package
Layout modelSemantic book structure, styled by the readerWeb-content model with reflowable and fixed-layout modes
Common extension.fb2.epub
Media typeapplication/x-fictionbook+xmlapplication/epub+zip
IANA statusUnregistered conventionRegistered

EPUB is usually the better interchange target when broad publishing-tool and store compatibility matters. FB2 remains useful for existing collections and reading systems built around its book-specific XML vocabulary.

Is a compressed FictionBook file still application/x-fictionbook+xml?

Not exactly. Raw .fb2 content is XML and uses application/x-fictionbook+xml. FictionBook books are also commonly distributed in ZIP form as .fb2.zip or .fbz; FBReader explicitly supports the compressed form.3

Poly models compressed FictionBook separately as application/x-zip-compressed-fb2 and maps .fbz to that type. It sends both raw and compressed variants through the same calibre conversion pipeline, but their outer file formats and identifiers are different. Do not label a ZIP container as XML merely because the archive contains an FB2 document.

Converting FB2 to EPUB or PDF

calibre chooses the output format from the destination extension, so an unprotected, valid book can be converted with:

ebook-convert book.fb2 book.epub
ebook-convert book.fb2 book.pdf

Choose EPUB when you want a reflowable format with broad modern support. Choose PDF when stable pages and printing matter. Conversion to PDF fixes the font, page size, and pagination selected by the converter. Conversion to EPUB must translate FictionBook-specific structures such as poems, notes, and embedded binaries into EPUB resources and markup.4

Check the result rather than assuming the conversion is exact. Review the cover, chapter order, table of contents, footnotes, poetry indentation, images, language metadata, and accented or non-Latin text. Keep the source .fb2 so a later conversion can start from the original semantic structure.

Treat an FB2 file from an unknown source as untrusted XML. Use a maintained reader or converter, keep XML external-resource access disabled when configuring your own parser, and avoid opening embedded links automatically. The book can also contain identifying document metadata and source URLs that you may not want to redistribute.15

Footnotes

  1. FictionBook project. FictionBook 2 XML Schema. Defines the namespace, root structure, metadata, bodies, links, and Base64 binary elements; the schema carries Dmitry Gribov's 2004 copyright. 2 3 4 5
  2. Internet Assigned Numbers Authority. Media Types Registry. The application registry does not include application/x-fictionbook+xml.
  3. FBReader. Book Formats Support. Lists fb2 and fb2.zip support on desktop, Android, and iOS. 2 3
  4. calibre. ebook-convert Command Documentation. Documents ebook conversion and dedicated FB2 input and output options. 2 3
  5. World Wide Web Consortium. XML External Entity Inclusion. Defines XML external entities and how a processor may retrieve external resources.
© Poly Corp. 2026