FictionBook 2.0 (.fb2)
FictionBook StandardFictionBook 2.0 (FB2) is a popular open semantic XML-based ebook format, packaging an entire book's text, typography, metadata, and embedded cover illustrations into a single standalone XML file.
Convert FB2 to EPUB
Free in-browser FB2 to EPUB converter. Convert files instantly on your device.
Inspect & Metadata
Operating systems and file analyzers identify FB2 files by inspecting the leading binary byte sequence:
Byte-Level Header Signature (Magic Bytes)
Operating systems and file analyzers identify FB2 files by inspecting the leading binary byte sequence:
HEX SIGNATURE (OFFSET 0):
3C 3F 78 6D 6CASCII REPRESENTATION: <?xml
Standardization: FictionBook Open XML Specification
Technical Specifications
| Container Architecture | Single self-contained XML document containing metadata, body chapters, poems, epigraphs, and Base64-encoded binary images |
| Compression | Uncompressed raw XML or zipped as .fb2.zip |
| Byte Endianness | UTF-8 / Unicode text stream |
| Color Spaces | Embedded image profiles |
| Channels & Structure | Semantic book structure (title-info, body, epigraphs, footnotes, sections) |
| Max Dimensions | Unbounded text length |
| Transparency | None in markup (embedded PNGs support transparency) |
| Streaming & Progressive | Sequential XML stream; footnote hyperlinks provide instant footnote jumps |
Technical Comparison Matrix: FB2 vs Competitors
| Technical Attribute | FB2 (Current) | EPUB | MOBI | TXT |
|---|---|---|---|---|
| File Structure | Single standalone XML text file | ZIP archive of XHTML/CSS/images | PalmDOC binary database | Plain raw text stream |
| Image Storage | Base64 embedded inside XML | Separate image files inside ZIP | Binary records in Palm database | None (text only) |
| Semantic Awareness | High (native poem, epigraph tags) | CSS class dependent | Primitive HTML tags | Zero semantic structure |
| Primary Region | Eastern Europe & PocketBook | Global / Western standard | Legacy Amazon Kindle | Universal |
Common Corruption Modes & Hex Recovery Guide
E-reader reports 'XML Parsing Error: mismatched tag at line X'.
Root Cause: Unclosed XML tag or unescaped ampersand ('&') inside book body text.
Recovery: Validate and repair XML schema tags using File2File FB2 Repair Tool.
Security Analysis & Parser Attack Vectors
FB2 is XML-based and vulnerable to standard XML parser attacks like XML Entity Expansion (billion laughs) and XXE.
Known Attack Vectors
- XML External Entity (XXE) injection reading local server files during automated book processing.
- XML entity explosion (billion laughs) consuming memory during XML DOM construction.
- Heap corruption during Base64 image decoding in unhardened C e-reader libraries.
Defensive Best Practices: Disable DTD processing and external entity resolution in XML parsers handling FB2 files.
Historical Origins & Milestones
Key Advantages & Pros
- Pure semantic markup: describes what text represents (poem, quote, footnote, epigraph) rather than how it looks.
- Single-file simplicity: all illustrations and cover images are embedded directly as Base64 text within the single XML file.
- Trivial to convert, index, and translate automatically due to standardized semantic XML tags.
Technical Limitations & Cons
- Lacks advanced CSS styling, custom web typography, and dynamic animations found in modern EPUB 3.
- Base64 encoding increases the file size of embedded illustrations by approximately 33%.
- Rarely supported on Western e-readers (Kindle, Kobo) without third-party firmware or conversion.
Interesting Technical Trivia
- FB2 was created in Russia and remains the most widely read ebook format across Eastern Europe, supported natively by every PocketBook device.
- In an FB2 file, footnotes are stored in a dedicated '<notes>' body section, allowing e-readers to display them as pop-ups.
- FB2 files can be viewed and validated in any standard web browser simply by opening the .fb2 file as an XML document.
Frequently Asked Technical Questions
What devices read FB2 files?
PocketBook e-readers, FBReader, Moon+ Reader, Calibre, and various Android/iOS reader apps read FB2 natively.
How can I convert FB2 to EPUB or PDF?
Upload your FB2 file to File2File.app to convert it into a beautifully styled EPUB or PDF book in seconds directly in your browser.
What is an FB2.ZIP file?
An FB2.ZIP file is simply a standard .fb2 XML file compressed using ZIP compression to save storage space on e-reader memory cards.