A note on Calibre before anything else: it is the de facto open-source ebook tool, not a Markdown converter. Its ebook-convert command will happily output Markdown, but the pipeline goes EPUB -> intermediate -> Markdown, and the intermediate step is where chapter titles sometimes flatten into body text. If you already use Calibre to manage a library, running ebook-convert on the same files costs you nothing and is the right first try. If you are starting from a clean slate, a dedicated EPUB-to-Markdown tool usually gets you cleaner headings on the first pass.
DRM is the honest complication nobody talks about. Most EPUBs you buy from Amazon, Kobo, or Apple Books are wrapped in DRM, and every legitimate converter on this list — Calibre included — refuses to touch them. Removing DRM from books you purchased sits in a legal grey zone in most countries and is flatly illegal in others. The clean path is to buy DRM-free directly from publishers (Tor.com, Smashwords, many technical publishers like O'Reilly and Manning all sell without DRM), or to source public-domain EPUBs from Project Gutenberg or Standard Ebooks. This is the part of the workflow most EPUB-to-Markdown guides quietly skip.
Kindle-to-EPUB-to-Markdown is a common, multi-step detour. If your source is a .azw3 or .kfx Kindle file, you first convert Kindle to EPUB (Calibre handles this for DRM-free books), then run the EPUB through a Markdown converter. Going directly from Kindle formats to Markdown is possible but less reliable because most Markdown tools treat EPUB as the reference input format. For a research workflow built on top of a personal library, the clean pattern is: buy DRM-free, keep originals in EPUB, convert to Markdown on demand for whatever AI assistant you are feeding.