Convert FB2 to AsciiDoc

Drag and drop files here or click to select.
Max file size 100mb.
Uploading progress:

FB2 vs AsciiDoc Format Comparison

Aspect FB2 (Source Format) AsciiDoc (Target Format)
Format Overview
FB2
FictionBook 2.0

XML-based ebook format developed in Russia. Designed specifically for fiction and literature with rich metadata support. Extremely popular in Eastern Europe and CIS countries. Stores complete book structure including chapters, annotations, and cover images in a single XML file.

Ebook Format XML-Based
AsciiDoc
AsciiDoc Markup Language

Lightweight markup language for writing documentation, articles, books, and web pages. Human-readable plain text that can be converted to HTML, PDF, EPUB, and other formats. Popular in technical documentation and publishing. Supports complex document structures.

Documentation Plain Text
Technical Specifications
Structure: XML document
Encoding: UTF-8
Format: Text-based XML
Compression: Optional (ZIP as .fb2.zip)
Extensions: .fb2, .fb2.zip
Structure: Plain text with markup
Encoding: UTF-8
Format: Human-readable text
Compression: None
Extensions: .asciidoc, .adoc, .asc
Syntax Examples

FB2 uses XML structure:

<FictionBook>
  <description>
    <title-info>
      <book-title>My Book</book-title>
      <author>John Doe</author>
    </title-info>
  </description>
  <body>
    <section>
      <title>Chapter 1</title>
      <p>Text content...</p>
    </section>
  </body>
</FictionBook>

AsciiDoc uses plain text markup:

= My Book
John Doe
:doctype: book

== Chapter 1

Text content with *bold*
and _italic_ formatting.

* List item 1
* List item 2

[source,python]
----
code block
----
Content Support
  • Rich book metadata (author, title, genre)
  • Cover images (embedded Base64)
  • Chapters and sections
  • Annotations and epigraphs
  • Footnotes and comments
  • Poems and citations
  • Tables (basic)
  • Internal links
  • Multiple bodies (main + notes)
  • Document attributes and metadata
  • Headings and sections
  • Text formatting (bold, italic, mono)
  • Lists (ordered, unordered, nested)
  • Tables (advanced)
  • Code blocks with syntax highlighting
  • Admonitions (NOTE, TIP, WARNING)
  • Cross-references and links
  • Include directives
  • Images and figures
Advantages
  • Excellent for fiction/literature
  • Rich metadata support
  • Single file contains everything
  • Widely supported by ebook readers
  • Free and open format
  • Good compression ratio (.fb2.zip)
  • Human-readable source
  • Version control friendly
  • Converts to multiple formats
  • Great for technical documentation
  • Modular (include files)
  • Active community and tooling
  • Supports complex layouts
Disadvantages
  • Limited outside Eastern Europe
  • Not supported by Amazon Kindle
  • Complex XML structure
  • Not ideal for technical docs
  • Manual editing is difficult
  • Learning curve for syntax
  • Not an ebook format directly
  • Requires conversion for reading
  • No embedded binary images
  • Less common than Markdown
Common Uses
  • Fiction and literature ebooks
  • Digital libraries (Flibusta, etc.)
  • Ebook distribution in CIS
  • Personal ebook collections
  • Ebook reader apps
  • Technical documentation
  • API documentation
  • Book publishing (O'Reilly)
  • README files and wikis
  • Man pages
  • Slide presentations
Best For
  • Reading fiction on devices
  • Ebook library management
  • Sharing books in CIS region
  • Structured fiction content
  • Technical writing
  • Documentation projects
  • Multi-format publishing
  • Collaborative writing
Version History
Introduced: 2004 (Russia)
Current Version: FB2.1
Status: Stable, widely used
Evolution: FB3 in development
Introduced: 2002 (Stuart Rackham)
Current Version: Asciidoctor 2.x
Status: Active development
Evolution: Continuous improvements
Software Support
Calibre: Full support
FBReader: Native format
Cool Reader: Full support
Other: Moon+ Reader, AlReader
Asciidoctor: Reference implementation
VS Code: Extension available
IntelliJ: Plugin support
Other: GitHub, GitLab rendering

Why Convert FB2 to AsciiDoc?

Converting FB2 ebooks to AsciiDoc format is useful when you want to repurpose fiction content for technical documentation, extract text for editing, or prepare content for multi-format publishing. AsciiDoc's plain text format makes it easy to edit, version control, and convert to various output formats including HTML, PDF, EPUB, and DocBook.

FB2 (FictionBook 2) is an XML-based ebook format extremely popular in Russia and Eastern Europe. It excels at storing fiction with rich metadata including author information, cover images, annotations, and structured chapters. However, FB2's XML structure makes manual editing cumbersome, and the format is primarily designed for reading rather than content creation or modification.

AsciiDoc provides a human-readable alternative that preserves document structure while enabling easy editing. The format is particularly valued in technical publishing - companies like O'Reilly Media use AsciiDoc for book production. By converting FB2 to AsciiDoc, you gain the ability to edit content in any text editor, track changes with Git, and generate multiple output formats from a single source.

Key Benefits of Converting FB2 to AsciiDoc:

  • Editable Source: Plain text format easy to modify in any editor
  • Version Control: Works perfectly with Git and other VCS
  • Multi-Format Output: Convert to HTML, PDF, EPUB, DocBook
  • Technical Publishing: Industry-standard for documentation
  • Modular Content: Include directives for large documents
  • Syntax Highlighting: Code blocks with language support
  • Cross-References: Advanced linking and navigation

Practical Examples

Example 1: Book Chapter Conversion

Input FB2 file (book.fb2):

<section>
  <title>Chapter 1: The Beginning</title>
  <p>It was a dark and stormy night.</p>
  <p>The wind howled through the trees.</p>
  <emphasis>Important text</emphasis>
</section>

Output AsciiDoc file (book.asciidoc):

== Chapter 1: The Beginning

It was a dark and stormy night.

The wind howled through the trees.

_Important text_

Example 2: Metadata Preservation

Input FB2 metadata:

<title-info>
  <book-title>The Great Adventure</book-title>
  <author>
    <first-name>John</first-name>
    <last-name>Smith</last-name>
  </author>
  <date>2024</date>
</title-info>

Output AsciiDoc header:

= The Great Adventure
John Smith
:doctype: book
:date: 2024
:toc: left
:icons: font

Example 3: Structured Content

Input FB2 with annotations:

<annotation>
  <p>This book tells the story of...</p>
</annotation>
<epigraph>
  <p>"To be or not to be"</p>
  <text-author>Shakespeare</text-author>
</epigraph>

Output AsciiDoc:

[abstract]
This book tells the story of...

[quote, Shakespeare]
____
To be or not to be
____

Frequently Asked Questions (FAQ)

Q: What is FB2 format?

A: FB2 (FictionBook 2) is an XML-based ebook format created in Russia in 2004. It's designed for storing fiction with rich metadata including author info, genres, cover images, and structured content. FB2 is extremely popular in Eastern Europe and CIS countries, supported by readers like FBReader, Cool Reader, and Calibre.

Q: What is AsciiDoc?

A: AsciiDoc is a lightweight markup language for writing documentation and books. It uses plain text with simple formatting rules that can be converted to HTML, PDF, EPUB, and other formats. AsciiDoc is popular for technical documentation and is used by companies like O'Reilly Media for book publishing.

Q: Will chapter structure be preserved?

A: Yes! FB2's section and title elements are converted to AsciiDoc headings (== for chapters, === for subsections). The hierarchical structure of your book is maintained, making the output easy to navigate and edit.

Q: What happens to images in FB2?

A: FB2 stores images as Base64-encoded data within the XML. During conversion, images are extracted and saved as separate files, with AsciiDoc image references (image::filename[]) pointing to them. This allows you to manage images separately from the text.

Q: Can I convert AsciiDoc back to FB2?

A: Yes, but indirectly. You can use Asciidoctor to convert AsciiDoc to EPUB or DocBook, then use Calibre to convert to FB2. However, some FB2-specific metadata may need to be added manually. The conversion chain would be: AsciiDoc -> EPUB -> FB2.

Q: What tools can I use to edit AsciiDoc?

A: AsciiDoc can be edited in any text editor. Popular choices include VS Code (with AsciiDoc extension), IntelliJ IDEA (with AsciiDoc plugin), Atom, Sublime Text, or even simple editors like Notepad++. Many provide live preview and syntax highlighting.

Q: How do I convert AsciiDoc to other formats?

A: Use Asciidoctor, the reference implementation. Commands: `asciidoctor file.asciidoc` (HTML), `asciidoctor-pdf file.asciidoc` (PDF), `asciidoctor-epub3 file.asciidoc` (EPUB). You can also use Pandoc for additional format options.

Q: Is formatting preserved during conversion?

A: Yes! Bold, italic, and other text formatting from FB2 is converted to AsciiDoc equivalents (*bold*, _italic_, `monospace`). Paragraphs, lists, and basic tables are also preserved. Some complex FB2 elements may be simplified.