Salicornia herbacea, a noted halophyte, has been widely researched for its diverse physiological activities. The continuous exploration of its compounds is essential. This study employed gas chromatography (GC) coupled with mass spectrometry (MS) for qualitative analysis. This involved pretreatment including trimethylsilyl (TMS) derivatization of the S. herbacea extract, facilitating its GC analysis. Five compounds, including various fatty acids and β-sitosterol, were identified by direct analysis of the methanol extract of S. herbacea without pretreatment by GC-MS. Conversely, the analysis of the TMS-derivatized extract revealed 28 distinct peaks. Quantitative analysis further indicated that the predominant compounds in the S. herbacea extract were sugars and sugar derivatives, notably glucose, fructose, and glucitol. The collective concentration of these sugars and its derivatives amounted to 116.45 mg/g, representing 11.6% of the dry weight of the raw S. herbacea. Following sugars and their derivatives, fatty acids constituted the next most abundant group of compounds. However, the presence of amino acids and organic acids was relatively low.