The characters from the anime and manga series Gin Tama were created by Hideaki Sorachi. The story is set in Edo, the "Land of the Samurai", which has been invaded by aliens named Amanto, who subsequently coexist with humans. Despite the time, there are various advanced technologies and even spaceships which allow people to travel across space. Although the series' story is commonly episodic, there are also a few story arcs which are developed through various chapters.
The story starts with teenager Shinpachi Shimura who is saved from a group of aliens attacking him by the samurai Gintoki Sakata. Shinpachi is amazed with Gintoki and decides to start working with him as a freelancer in order to learn "the ways of the samurai" while he helps Gintoki in work to pay the monthly rent from where he lives. Both also meet Kagura, a young female alien who belongs to the Yato Clan, one of the strongest Amanto races. The three of them become known as "Yorozuya" and while they work as freelancer, they also come to meet Gintoki's former comrades during the Amanto's invasion such as the terrorist Kotaro Katsura as well as Shinsuke Takasugi, a major antagonist throughout the series. They also encounter several times the police force Shinsengumi, who normally ally with Yorozuya in their works, since they commonly involve dangerous criminals.
When creating the series, Sorachi developed various characters based on the historical Shinsengumi, which he is a fan of. Additionally, other characters from the series are also based on real people. The characters from the series have also been features in pieces of merchandise based on their appearances as well as video games. Response to the characters has commonly been mixed, with various publication praising the comedy situations and criticizing the artwork used in the series.
Before the start from Gintama's serialization, Hideaki Sorachi wrote various one-shot manga. Although he considered the story Samuraider very poor, the setting of such one-shot served as the base for Gintama such as the addition of alien characters. While thinking of the name of a manga, Sorachi's editor commented "Do you think a silver samurai would be cool?" That inspired Sorachi to write the main character from the series after deciding the series should be named Gintama. However, the main character was originally meant to be Hijikata Toushiro as Sorachi was a fan of the Shinsengumi, most notably Hijikata Toshizō (the Shinsengumi who was the base for the one of Gintama), after he saw Burn! Sword!. When Sorachi could not "shake off" Hijikata's initial design, he decided not to use him as the lead character, but added him along with the Shinsengumi to the story. The pilot chapter from the series had a different plot to the one from the serialization: Sorachi kept adding Shinsengumi to the story such as Harada Sanosuke. As all of these characters were older than most of the recurring ones from the series, Sorachi removed them thinking they were not entertaining.