Ginger (Zingiber officinale Rosc; Zingiberaceae family) is an herb commonly used as a spice and remedy for a broad spectrum of diseases. The essential oil extracted from ginger is an effective antioxidant, anti-inflammatory, and antifungal agent. The present study has investigated the variations in yield and chemical composition of essential oils of two cultivars (Chinese and Thailand) of ginger locally available in Pakistan. Two different drying pretreatments were employed to observe the changes in compositional variations of the essential oils of ginger. The essential oil extracted from fresh, oven-dried, and sun-dried samples of two different cultivars of ginger was analyzed using gas chromatography-mass spectrometry (GC-MS). The essential oil yield was found to be highest for the sun-dried sample of each variety. The major compounds (>4%) overall in the essential oil of fresh, oven-dried, and sun-dried ginger samples from Thailand origin were camphene, 3-carene, o-cymene, caryophyllene, α-curcumene, sabinol trans, citral, and santalol. Major compounds overall in the essential oil of fresh, oven-dried, and sun-dried ginger samples of Chinese origin were α-pinene, Camphene, limonene, longicyclene, copaene, longifolene, β-sesquiphellandrene, alloaromadendrene, γ-muurolene, α-curcumene, α-farnesene, and citral. The inter-varietal variations and pretreatment methods considerably affected yield and chemical composition. Cluster analysis was performed to validate the results further. Significantly varying compounds responsible for the significant variation among varieties and treatments of the ginger were identifies by using the heat map. There was clear differentiation among Chinese and Thailand varieties due to the variation in the concentrations of the volatile compounds. The results obtained can be helpful for the ginger growers and end users to choose the ginger variety and the way of use that is more beneficial.