Hanzō, the son of Hattori Yasunaga, was born a vassal of the Matsudaira (later Tokugawa) clan, and served Tokugawa Ieyasu; he would later earn the nickname Oni-Hanzō (鬼半蔵 Devil Hanzō ) because of the fearless tactics he displayed in his operations. His nickname distinguishes him from another Tokugawa samurai, Watanabe Hanzō, called Yari-Hanzō (槍半蔵 Spear Hanzō ).
Though Hanzō was born and raised in Mikawa Province, he often returned to Iga Province, home of the Hattori family. He was an extremely skilled swordsman, tactician and spearman. Onmyodo, a Chinese system of divination propagated in Kyoto by Abe no Seimei, had been brought from the capital. The village of Yagyū, along the Kyoto-Nara border, was home to a venerable school of sword technique. The Hōzōin temple in Nara supported a unique school of spear fighting, the Hōzōin-ryū.
Hattori, who fought his first battle at the age of 16, went on to serve at the battles of Anegawa (1570) and Mikatagahara (1572), but his most valuable contribution came in 1582, following Oda Nobunaga's death.
He was succeeded by his eighteen-year-old son, whose name was also Masanari, though written with different kanji. His son was given the title "Iwami-no-Kami" and his men would act as guards of Edo Castle.
To this day, artifacts of Hanzō's legacy remain; the Tokyo Imperial Palace (formerly the shogun's palace) still has a gate called Hanzō's Gate, and the Hanzōmon subway line which runs from central Tokyo to the southwestern suburbs is named after the gate. Hanzō’s remains now rest in the Sainen-ji temple cemetery in Shinjuku, Tokyo. The temple also holds his favorite spears and his ceremonial battle helmet.
As a historical samurai in one of Japan's greatest periods of samurai culture, Hattori Hanzō has significant cultural resonance among admirers of that culture, both within Japan and abroad. In the modern popular culture he is most often portrayed as a ninja, involved with the Iga ninja clan.
Many films, specials and series on the life and times of Tokugawa Ieyasu depict the events detailed above. For example, Hattori Hanzō appears in the novel Fukurō no Shiro (Owl's Castle), later made into two feature films. The actor Sonny Chiba played his role in the V-Cinema series Kage no Gundan. In the 2009 film Goemon, Hanzō appears as a legendary shinobi and has a significant supporting role (played by Susumu Terajima).
The life of Hanzō and his service to Tokugawa Ieyasu is fictionalised in the manga series Path of the Assassin. Hanzō also appears in the manga/anime series Basilisk, Gintama, Samurai Deeper Kyo and together with his clan in Tail of the Moon. In Tenka Musō young Hanzō is the main character. In Ninja Hattori-kun, the main character Kanzo Hattori's name is a pun on Hanzō.
Hanzō appears as a recurring character in the Samurai Shodown video game series, appearing in every game in the series. In World Heroes, another SNK series, Hanzō serves as one of the main characters, and is portrayed as rivals with Fūma Kotarō, also featured in the games (their rivalry is based upon the legend surrounding Hanzō's death). He is also featured in video game series Samurai Warriors, where he is portrayed as a highly skilled ninja, highly loyal to Tokugawa Ieyasu and attributed to the death of many of Ieyasu's rivals, including Imagawa Yoshimoto, Takeda Shingen, Toyotomi Hideyoshi and Sanada Yukimura, and having an extremely fierce rivalry with Fūma Kotarō. In the first two games of the Gensou Suikoden series, a character named Hanzo is the leader of the hidden ninja village of Rokkaku. Hattori Hanzō is also featured in the games Kessen III and Civilization IV: Beyond the Sword.
In the film The Machine Girl, the villains (yakuza said to be descendants of ninja) state that Hattori Hanzō is their family's name. The manga and anime series Basilisk (as well as its feature film adaptation Shinobi: Heart Under Blade) features a character named Hattori Kyohachiro as an attendant to the shogun, being the son of the second Hanzō, and adopted son of the fourth Hanzō. Another Hanzō clan's descendant, private investigator Hanpei "Hanpen" Hattori, appears in Android Kikaider. In the film Kill Bill, Sonny Chiba plays Hattori Hanzō, a master swordsmith who is called upon to create a katana for the film's protagonist; it has been implied that this character is a descendant of the historical figure.