The calibre E-book editor allows you to edit the text and styles inside the book with a live preview of your changes.
It can edit books in both the EPUB and AZW3 (kindle) formats. It includes various useful tools for checking the book for errors, editing the Table of Contents, performing automated cleanups, etc.