Summary:
- He followed all the laws of kosher diet.
- He abstained from anything made from grapes as required for a Nazirite vow.
- He seems to have lived off the fallow land, at least during the times he was baptizing by the Jordan, as Elijah had done for a time, relying on God to provide for him day by day.
- Though this is never specifically mentioned in the gospels, he was a fully active priest, and therefore would have eaten meat and bread made from grain brought in sacrifice while on rotation in the Temple, as required by Torah.
- When not working in the Temple, he abstained from bread. This could be from all bread or only from leavened bread (chametz).
From the gospels and the Torah we learn about several restrictions on the diet of Yochannan (John) the Baptist.
First, as for any Jew, he had to follow the laws of clean and unclean foods. These laws permit eating locusts specifically (Leviticus 11:22) but not other "creeping things". There are indications that the gospel description of his diet does not refer to literal locusts but to Carob fruit. The text translated "locust" in Latin is locusta, in Greek akrides and in Aramaic qamsa, all literally meaning the locust insect. But this still could just be the nickname for a fruit that does sort of look like a locust maybe - judge for yourself. There is also the question of whether it would have always been possible to obtain live locusts, or carob fruit, for food year-round. I have no idea. Whether literal locusts or fruit found growing wild, Yochannan ate kosher.
Secondly, Yochannan was a priest. This is known because his father Zakarya (Zechariah) was a priest of the order of Abijah (Luke 1). There are some additional dietary laws specific to the priestly order, mostly concerning the eating of meat and grain brought in sacrifice.
Thirdly, Yochannan lived under a Nazirite vow from birth until at least the day he baptized Yeshua (Jesus) in the Jordan river. This is clearly implied by the instructions given by the Messenger (angel) to his father Zakarya in the Temple, that he should not partake of grapes (Luke 1). So anything containing grapes or any product of grapes was additionally forbidden to him. The messenger actually said, "wine or strong drink", implying other forms of alcohol were also forbidden to him, even though Torah does not explicitly require this for the Nazirite.
But these are only the restrictions in law. It could also be asked, why not eat fish, which are perfectly kosher? Or why not eat the unharvested grains in the farmers' fields, as allowed under the law (and which Jesus and his disciples are known to have done)?
I humbly suggest that these mentions of what he ate should not necessarily be interpreted to mean that Yochannan ate only these foods exclusively. Rather, this description relates what he was known for eating. It became part of his public image that he ate like this. (Who knows, maybe "locusts and wild honey" was a recipe using carob fruit that he especially liked.)
While in service in the Temple, he would have eaten whatever meat and grain was brought in sacrifice, as well as the Temple bread. The law requires that, in fact. And we know he was in active service and on the Temple rotation because he, like Yeshua his cousin, had recently reached the age of thirty, when priests are commanded to enter full duty (Numbers 4:3).
It must be mentioned that multiple resemblances between Yochannan and the prophet Elijah are evident and were called to attention by Yeshua. He wore sackcloth (camel hair) as Elijah did, symbolizing repentance. He came to the river Jordan in possibly the exact place where Elijah was taken up in a chariot of fire. His diet may also have reflected Elijah having relied directly on God to provide his food in the wilderness day to day.
Finally, in Luke 7:33 we learn that Yochannan did not eat bread. Whether this is only an abstinence from leavened bread (Hebrew: chametz), or from all types of bread, I do not know. Abstinence from all bread would have been consistent with relying on God to provide his food and living off the land directly. He seemingly relied on God to provide for him day by day, just as the nation did in the wilderness relying on manna.