It’s possibly presumptuous of me to describe the following list as “the best”. Really, the following programs are just “my favourite”. But I’ve shopped around and there are good reasons why these are brilliant. Any other recommendations? Please comment below!

Sublime Text Sublime Text
Absolutely perfect text and code editor. Makes editing all the code documents you might find in an ebook – (x)html, css, xml, opf, ncx, js – a complete dream. And it’s essentially free, though I thoroughly recommend shelling out for the user license. Exemplary features: edit at multiple locations in the same document simultaneously, coloured code syntax for visual ease, a million other things…
Sigil Sigil
Frankly, I don’t think I could face ebook development without it. Automates lots of aspects of ebook creation: link and tag updates, table of contents creation, metadata input, everything really. And it’s 100% open source and free. Crazy not to.
7-Zip 7-Zip
The last (un)zip software you’ll ever need. Unpacks/extracts “.epub” and “.mobi” files as well as any other compressed folder (“.zip”, “.rar” etc.), so you can have full access to edit any aspect of ebooks in either format.
Kindle Previewer Kindle Previewer
Something for which we can be grateful to Amazon. It allows you to test your Amazon ebooks on most Kindle devices and apps (although I’ve noticed some bugs in version 2.9 for iOS emulation – at the moment I’m relying on an iPad for iOS testing of “.mobi” ebooks). Can convert epub and html files to “.mobi”, and I also use it to re-pack “.mobi” ebooks that I’ve unpacked earlier using 7-Zip for editing.
Pagina EPUB-Checker EPUB-Checker
There are several programs based on the IDPF’s epub validation tool, this is probably the easiest to use. Drag-and-drop your epub ebook onto the open program, it tells you whether or not its code is valid.