Both appropriately use the kanji 豆 (mame), which means "beans." And the other two kanji in question here are 腐, which is used in words like "to spoil" (腐る, kusaru), and 納, which refers to something fitting neatly into a designated space. (Yes, seriously. That's a meaning of 納まる, osamaru).
So, we've got tofu, all packed into its neat little white squares, and natto, rancid and fermenting, but the kanji don't line up. Sure seems like somebody screwed these two words up, doesn't it?
Turns out there's an urban legend in Japan to just that effect:
A customs official in ancient Japan marking off boxes arriving on a ship from China accidentally labeled the crates of tofu with the natto kanji and the crates of natto with the tofu kanji. And that's why to this day we use the "wrong" kanji to refer to these two foods.
...So the story goes.
The truth is, 豆腐 was used as the kanji for tofu in China, prior to the food's introduction to Japan. And natto was first made--and named--in Japan. So what's the actual rationalization behind these names?
|What?! Natto and tofu together?!
That's just silly.
So what about tofu? Well, this food's older*, and the reason for its naming is a bit more mysterious. One commonly cited theory is that it was named as such because it was used as a substitute in diet for diary products like yogurt, which involves fermentation of milk. Another possibility is within the kanji 腐 itself, which didn't always refer exclusively to food spoilage: The origin of the kanji refers to intentional ageing of meats in storehouses, and it may have also been used to refer to curdling and coagulation, which is an important part of the tofu production process.
Incidentally, the kind of tofu brought from China and popularized in Japan is known as "watery tofu" in China, where the most common varieties of tofu are strained more thoroughly than even the momen type often eaten in Japan. And varieties of tofu intentionally fermented and sold as such are also part of the Chinese market, though this isn't considered the "original" state of the food.
*Old enough, in fact, that although it's very probable the food was first produced in China, the strongest evidence we have is just a legend dating back to 150 BC.
Is that more than you ever wanted to know about two foods that you may not even like? Check out our other awesome non-daizu-related articles and follow us on Facebook and Twitter for updates about our latest stuff!