All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
Gelatin can be taken from an eatable animal that is slaughtered in a way accepted by the Sharee’ah. This kind of gelatin is lawful. On the other hand, if the gelatin is taken from a non-eatable animal, or an eatable animal but not slaughtered according to the Sharee’ah, then it is unlawful to use it unless there is a dire necessity for that because it is included in the things that are generally considered unlawful except in dire necessity.
Allah Says (what means): {…while He has explained in detail to you what He has forbidden you, excepting that to which you are compelled.} [Quran 6:119]
The above ruling concerns the gelatin that has not been transformed from its origin as a raw material. However, if this gelatin has been processed and has consequently changed into a different substance before being added to the food, then, in this case, this new product is lawful because the initial product (gelatin) has changed into a different product, hence a lawful product.
For more benefit on gelatin in food, please refer to Fataawa 160467, 275287, 82089, 89340, 90844, and 90894.
Allah knows best.