The story is set in an alternate late-Edo period, where humanity is attacked by aliens called “Amanto” (天人, “Sky People”), and the samurai of Japan join the battle against the aliens, but when the Shogun realizes the power of aliens, he betrays the samurai and surrenders to the aliens. The Shogun writes an unequal contract with aliens which allows the aliens to enter the country and places a ban on carrying swords in public. The swords of samurai are taken away so they can no longer resist the aliens. After that, the Shogunate becomes a puppet government.
The plot is focused on an eccentric samurai, Gintoki Sakata (a.k.a. Odd Jobs Gin), who helps a teenager named Shinpachi Shimura save his sister Tae from a group of aliens who want to make her part of a brothel. Impressed with Gintoki, Shinpachi becomes his apprentice and works with him as a freelance odd-jobs man in order to pay the monthly rent on Gintoki’s combination home and office, as well as to know more about him. The two of them rescue a teenage alien girl named Kagura from a group of Yakuza who wanted to use her superhuman strength to kill people. Kagura joins Shinpachi and Gintoki to work as freelancers and the three become known as “Yorozuya” (万事屋, “We do everything” or literally “The Anything Store”).
While doing their job, they encounter the police force Shinsengumi several times, who normally ally with Odd Jobs Gin in their work since the jobs commonly involve dangerous criminals. They eventually meet some of Gintoki’s former comrades from the fight against the Amanto’s invasion, including the revolutionary Kotaro Katsura who maintains a friendly relationship with them despite his terrorist activities against the bakufu. On the other hand, Shinsuke Takasugi acts as a major antagonist throughout the series, as he wants to destroy the bakufu and sees his former comrades as enemies.