It is said that originally "natto" meant stored soybeans and "tofu" meant fermented soybeans and at a certain point those names were exchanged; this theory, however, is just a popular saying that emerged during the modern era.
「本来は豆を納めたものが『納豆』、豆を腐らせたものが『豆腐』だったのが、いつの間にか名前が取り違えられた」などとも言われるが、近代になって作られた俗説に過ぎない。