Shihei was born the second son of Hayashi Gonhyoue Yoshimichi, a hatamoto who served the Tokugawa shogunate. However Yoshimichi was expelled for some reason; some argue it was the result of a conflict with his colleagues (perhaps a duel). After that, Shihei was brought up by his uncle Hayashi Jyugo, a physician. He spent most of his life in his bedroom. He wrote a poem called "Six No's", which reads: "I have no parents, no wife, no son, no block for printing, no money, and I wish for 'no death'."
His elder brother, Hayashi Kazen became one of the Sendai domain's official doctors. Years before Commodore Perry sailed into Japan in 1853, Shihei was pushing for Japan to adopt Western military science and the re-education of the samurai. He complained of the lack of organized drill exercises, and stressed the importance of chōren, or teamwork drill, rather than mere individual martial training. He gave a lot of technical descriptions about shipbuilding, cannons and other military designs. He published these thoughts in his work titled Kaikoku Heidan (i.e. Discussion concerning military matters of a maritime nation), printed without permission of the bakufu in the year 1791. The printing blocks were confiscated soon afterwards. Another famous work is Sangoku Tsūran Zusetsu (Illustrated Description of Three Countries), printed in 1786.