This study aimed to investigate the potential use of Aloe vera (AV) as a food additive given its critical importance in food safety and health. Specifically, the natural antimicrobial and antioxidant properties of AV were examined to prevent food spoilage and extend its shelf life. This study was conducted using commercially available aloe vera gel (AVG) and aloe vera extract (AVE). These samples were tested using gas chromatography–mass spectrometry (GC–MS). The analysis involves identifying and quantifying the components using natural helium gas. The antimicrobial and antifungal effects of these components were evaluated and compared with those reported in the literature. GC–MS analysis revealed that the Aloe vera gel and extract contained various volatile components, including phenolic compounds, anthraquinone glycosides, and different esters. According to GC–MS results of the two different forms of AV, the main volatile compounds of the gel form were levoglucosan, tridecanoic acid, decanoic acid methyl ester, octadecanoic acid methyl ester, octadecanoic acid, nonadeca-1.18-diyn-4.16-diol and squalene, whereas the extract form contained volatile compounds with antifungal activity such as tridecanoic acid, octadecanoic acid methyl ester, octadecanoic acid, nonanoic acid and eicosyl acetate. Both samples exhibited antimicrobial and antifungal activities, especially against pathogens such as Staphylococcus aureus, Candida albicans, Aspergillus niger, and Escherichia coli. This study demonstrated the potential of Aloe vera gel and extract as a natural preservative for use in food because of its constituent components. This study highlights the potential use of Aloe vera as a natural additive in the food industry. Due to its antimicrobial and antifungal properties, Aloe vera offers an organic alternative to chemical additives. Aloe vera is effective at preventing food spoilage and extending shelf life, making it a suitable option for meeting consumer demand for organic and natural products.