What was the reasoning behind the use of atomic bombs on japan?

The bombs saved American lives by ending the war sooner

The Japanese would not surrender unconditionally, prolonging the war and costing many lives.

The bombs would make the war less costly