Can't say for sure that it's still good but if you want to do it once without installing a program and fiddling around with all the settings then that should probably work just fine.
Otherwise calibre offers a very feature rich ebook conversion tool but goddamn do I only understand half of the functions in that app. Still it's by far the most powerful and feature rich app for ebooks.
Occasionally I've been known to make epubs out of PDFs. It's painstaking work and it takes hours to comb through each page manually when doing this. (There's a few on LibGen of my work like Blood In My Eye by George Jackson and Dimitrov's Selected Speeches, from the publishing date prior to this work being heavily edited in the post-Stalin era.)
The thought of someone undoing all that work almost makes me want to cry lol.