What is the FB2 file format?
Files with the .fb2 extension (FictionBook 2.0) are eBook files supported by a wide range of reading devices and applications. The format is based on XML and, unlike the EPUB format (which packages data in multiple files inside a single ZIP container), its entire structure consists of a single XML file. The format originated in Russia, where it was developed by Dmitry Gribov and the FictionBook community around 2004, and gained its greatest popularity there - initially in the domain of fantasy literature.
Structure of an FB2 file
Data contained within .fb2 files includes titles and publishing metadata such as author information, the ISBN number, the publishing house, and structural markup for prose or verse - making this format well suited for indexing and cataloguing eBooks. The format is widely used by various indexing tools and library software. In addition to the text, all images are embedded directly in the XML file, converted to Base64 and placed inside <binary> tags at the end of the document.
Due to the Base64 encoding method, the volume of embedded images is almost 40% bigger than the originals. For this reason, .fb2 files are often distributed compressed into .fb2.zip or .fbz archives - standard ZIP packages that most devices and programs support directly. The format is open, DRM-free, and uses the MIME type application/x-fictionbook+xml.
Worth knowing about FB2
Because the binary image data is placed at the end of the XML file, a reading application can begin rendering the text before the file has finished loading. Additionally, by renaming the .fb2 extension to .zip, one can obtain direct access to the text content and metadata of an eBook by unpacking it with any standard archive tool such as 7-Zip.
Security & safety
RISK: LOWFB2 is a plain-XML, DRM-free text format and is among the safer e-book formats - it carries no scripting of its own, so the file itself is low-risk. The practical risks are the sources: many FB2 books come from free/pirate libraries that wrap downloads in adware or fake 'download' buttons, and (rarely) a malformed FB2 could try to exploit a bug in an outdated reader. Keep your reader app updated and prefer reputable sources. Because FB2 is just XML, you can safely inspect one in a text editor before opening it in a reader.
Format details
in a nutshellPrograms that open FB2 files
Technical details
deep spec| Format type | Single XML document; all text and embedded images stored in one file |
| Root element | <FictionBook> with XML namespace xmlns="http://www.gribuser.ru/xml/fictionbook/2.0" |
| Character encoding | UTF-8 (declared in XML prolog: <?xml version="1.0" encoding="utf-8"?>) |
| MIME type | application/x-fictionbook+xml |
| File signature | Starts with XML declaration <?xml (hex 3C 3F 78 6D 6C); no binary magic bytes - compressed .fb2.zip starts with ZIP header PK (50 4B 03 04) |
| Image storage | JPEG and PNG images embedded as Base64 in <binary> elements placed at end of the XML document |
| Base64 size overhead | Embedded images are approximately 33-40% larger than the original binary files |
| Compressed variants | .fb2.zip and .fbz - standard ZIP archive containing a single .fb2 file inside; supported natively by most FB2 readers |
| DRM | None; the format is DRM-free by design |
| Book metadata elements | <title-info> inside <description> holds title, author(s), genre, annotation, ISBN and cover; <publish-info> holds publisher, year and city |
| Structural markup | Supports sections (<section>), poems (<poem>, <stanza>, <v>), epigraphs, citations and footnotes via internal href links |
| Text formatting | Bold (<strong>), italic (<emphasis>), strikethrough, superscript, subscript - all expressed as named XML elements |
| Progressive rendering | Binary data placed after the text body; readers can display full text content before embedded images finish loading |
| Origin and primary market | Developed in Russia by Dmitry Gribov and the FictionBook community; dominant format in Russian-language digital book libraries |
| Typical uncompressed size | 50-500 KB for text-only books; larger files when illustrations are embedded due to Base64 overhead |
| Released | 2004 (FictionBook 2.0); also distributed compressed as .fb2.zip / .fbz |
| Open standard | Yes · royalty-free |
| Specification | www.fictionbook.org |
FB2 conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about FB2 files.