The shortest war ever was fought between Britain and Zanzibar and lasted 38 minutes.
The title of shortest war of all time goes to the Anglo-Zanzibar War, which was fought between Great Britain and the Zanzibar Sultanate from 9:02 a.m. on August 27, 1896, to 9:40 a.m. on August 27, 1896. Yes, this war lasted just 38 minutes.