Are insects halal to eat according to Islamic law?
From my understanding of Quran and Islam, there is a simple rule that I follow in my life: If something is not forbidden directly or indirectly in Quran, then it is allowed.
An example to directly forbidding: Killing someone without a valid reason is directly forbidden as you can read in verses 2:178, 4:92-93, 5:32, 6:151, 17:33 and 25:68.
An example to indirectly forbidding: Using pirated software. You won't find any direct verse that forbids this act because there were no computers or software when Quran was sent, hence that age's people wouldn't understand. However, stealing is directly forbidden in this verse: 5:38. Downloading and using a commercial product which is listed for sale by its owner, that you haven't purchased the right to use, is of course a kind of stealing.
If we come to your question, verses 2:173, 5:3, 6:145, 16:115 clearly (and directly) explain what are forbidden to eat, unless it is a die-or-live situation, and even in that case, without overdoing it and without doing anyone injustice.
Verse 22:30 tells that other than the mentioned things, all other animals are halal to eat.
In addition to those, verse 6:145 refers to the flesh of swine (pig) as impure. I take it as eating unclean and/or unhealthy food is indirectly forbidden. So, the criterion for safely eating something, in addition to whether it is directly forbidden in Islam or not, is whether it is clean and whether it contains any disease, harmful viruses/bacteria etc. and whether it has been living in clean areas. That's surely for our own health. For example, if you know a halal food, e.g. chicken, has a deadly virus, but you still eat or serve it to others, in that case eating that food becomes haram in my understanding, because you are knowingly harming yourself and/or others.
I will leave the conclusion to you.
All Praise to Allah Subhanahu wa Taala and blessings of Him be on Prophet Muhammad peace be upon him His family and companions,
Insects are not considered as Halal with an exception of the locust.
It was narrated that Abuy ya fur said: "I asked 'Abdullah bin Abu Awfa about killing locusts and he said: I went on six campaigns with the Messenger of Allah hand we ate locusts."(Nasai)
It was narrated from ‘Abdullah bin ‘Umar that the Messenger of Allah (ﷺ) said: “Two kinds of dead meat have been permitted to us: fish and locusts.”(Ibn Majah)
If insects are in a insignificant amount in a food or they are fallen in some food or drink and is not easy to remove in such a case it would not be considered as Haram to eat with and if there is no food available and has a fear of death in such a case that would be permissible too in order to save a life.
Also see here for more information http://seekershub.org/ans-blog/2011/03/04/what-animals-are-halal-and-haram-to-eat-in-the-hanafi-school/
Allah Swt and His Messenger knows best.