A recent AskReddit thread on the atomic bombs got me thinking. The American gov. (and allot of average Americans from my personal experience) say they had to drop the bombs because an invasion of the main islands of Japan would have caused 10x or more military and civilian casualties and because of that the bombs actually saved lives.
Yet, did this implies the US HAD to invade the mainland, like achieving total-surrender was the only option. But at this point Japan had been pretty much defeated right? The US had taken their empire from them, the US homeland was no longer under threat. Why couldn't there have just been a ceasefire and peace? The Japanese had to have known their position was hopeless, especially with the fall of Germany and Russia about to enter the theatre. Surely they would have accepted any deal that left them in control of Japan and stay alive?
There's a fairly large section of our FAQ on the atomic bombings of Japan and what actually led to the end of the war.
One thing I'd point out is that the "bomb OR invade" narrative is entirely an invention of the post-war period, to justify the atomic bombings. War planners in Washington were focusing on an invasion because that was seen as the likely end-game of the war in the Pacific as it had been in Europe (and it's also worth noting that there were very few war planners who actually knew that the atomic bombs existed) Those who did know about the Manhattan Project actually discussed incorporating atomic weapons into the invasion -- they were asking whether it would be feasible, say, to use a bomb to clear an invasion beach, or to attack columns of troops out in the open, and such.
Second, avoiding Japanese casualties was very much not a concern of Allied war planners; the United States had already bombed ~70 or so Japanese cities with napalm and other incendiary devices by the time the atomic bombs were available; Japanese cities had been destroyed to the extent that there was a list of cities "reserved" from fire-bombing so that the atomic bombs could be used on them.
It might be interesting to you to read this answer from our resident nuclear expert, /u/restricteddata, which answers the opposite question you pose: "Did the US have to nuke Japan in WWII?"