To convert an FB2 book to Markdown on Windows, add the FB2 file or a folder of books to MD Factory. Conversion starts right away, and the Markdown file appears next to the book, with the illustrations in a folder beside it.

An FB2 book is a single XML file. It holds the text, the footnotes and the illustrations, and it marks every chapter and title. MD Factory builds the headings from those marks, so the Markdown follows the book's own table of contents.

An open book with lined pages next to a closed notebook with a lilac pencil and a ribbon bookmark.
The book and your notes on it, in one place.

Convert an FB2 book

  1. Open MD Factory and click Add files to choose one or more FB2 books. To convert a whole library, click Add folder: books in its subfolders are included. You can also drag files or a folder onto the window.
  2. Conversion starts at once. Each book gets one of three statuses: Completed, Needs review or Failed.
  3. When the list is done, click a book to see its messages and open the folder with the result.

Each book gets a Markdown file with the same name, saved next to it. The illustrations go to a folder beside the Markdown file:

Library/
  book.fb2
  book.md
  book_images/
    image-3f9c0a7d21e84b56c0d1.png

The FB2 file itself stays unchanged. If MD Factory cannot write to the book's folder, it asks where to save the result.

What each part of the book becomes

In the FB2 bookIn the Markdown file
Title and authorThe author's name on the first line, then the title as the top-level heading
Chapters and nested sectionsHeadings, one level deeper for each level of nesting, down to the sixth
Bold and italic textKept as bold and italic
Epigraphs and quotationsQuote blocks, with the quoted author on the last line
PoemsQuote blocks with every line kept separate; the poem's title becomes a heading inside the quote
FootnotesLinks in the text; the notes themselves at the end of the file
IllustrationsPNG images in the folder next to the Markdown file, at the same place in the text
TablesThe text of the cells, run together without the grid; the book gets Needs review
The annotation and the cover from the book's descriptionNot included

FB2 keeps footnotes in a separate part of the file. MD Factory puts that part at the end of the Markdown file, under the heading Notes and the book's own heading for the notes. A footnote number in the text stays a link to its note. If your Markdown app does not follow such links, look for the number at the end of the file.

In the raw file, asterisks, underscores and square brackets from the book's text have a backslash in front of them. That stops a scene break made of three asterisks from turning into formatting. Markdown viewers do not show the backslashes.

Books in Windows-1251 and other encodings

An FB2 book can be saved in UTF-8 or in an older encoding such as Windows-1251. The first line of the file says which one:

<?xml version="1.0" encoding="windows-1251"?>

MD Factory reads the book in the encoding named in that line and always saves the Markdown in UTF-8. Cyrillic text from a Windows-1251 book comes out readable.

If that line names the wrong encoding, or the file was damaged during download, the book fails with the message "This file is damaged or does not match its extension." Download the book again or take it from another source.

Zipped books and FB3

MD Factory does not open archives. A book saved as .fb2.zip appears in the list as skipped, with the message "This file format is not supported." Removing .zip from the name does not help: the file is still a ZIP archive.

Unzip the book first. In File Explorer, right-click the archive, choose Extract All and follow the steps. Microsoft describes them in its guide to zipping and unzipping files.

For a library with many zipped books, PowerShell can unpack them all at once. Open PowerShell, go to the library folder with the cd command and run:

Get-ChildItem -Recurse -Filter *.fb2.zip | ForEach-Object { Expand-Archive -LiteralPath $_.FullName -DestinationPath $_.DirectoryName }

Each archive is unpacked into the folder where it lies, and the archives stay in place. Expand-Archive does not overwrite files that already exist. Then add the library folder to MD Factory: the books are converted, and the archives are listed as skipped.

MD Factory reads FB2 only, so FB3 files are skipped as well. If a store offers a book in both formats, download the FB2.

Check the converted book

Open the Markdown file and compare a few places with the book in your reader:

  • the headings, which should follow the book's table of contents;
  • one footnote: the link in the text and the note at the end;
  • an illustration, a poem and an epigraph, if the book has them.

If a book has Needs review status, click it in the list to see why. For FB2 books, the message is usually one of these:

MessageWhat it means
"An image could not be exported."An illustration is missing from the file or damaged. The rest of the book is converted.
"Merged or complex cells were simplified. Check the table."The book contains a table. Its text is in the Markdown file, but not as a table.
"A local link target could not be preserved."A link in the book points to a file on a disk, not to a website or a place in the book. The link text is kept.

To keep converted books in your notes or read chapters with an AI tool, see our guide to converting ebooks to Markdown. Other book formats have their own guides: EPUB and MOBI.