The thing is, Japan was ready to sacrifice every last citizen before it surrendered. We had them beaten back onto the mainland, and they weren't going anywhere. But instead of saving a lot of lives by surrendering, they were prepared to fight to the literal death of Japan. So, to avoid disasterous losses, we nuked them. Took 2 nukes to do it, too. They still were ready to fight after Hiroshima. Having it happen AGAIN finally convinced them that their fight was over.