This study investigated the vitamin D level of nine species of cultivated mushrooms and three species of wild mushrooms commonly consumed in Thailand and the effect of cooking on their vitamin D content. Cultivated mushrooms were obtained from three wholesale markets, while wild mushrooms were collected from three trails in a conservation area. Mushrooms from each source were separated into four groups: raw, boiled, stir-fried, and grilled. Different forms of vitamin D were analyzed using liquid chromatography with tandem mass spectrometry (LC-MS/MS). The analyzed method demonstrated good linearity, accuracy, and precision, as well as being low in the limit of detection and limit of quantitation. Results showed that vitamin D2 and ergosterol (provitamin D2) were the major forms of vitamin D found in the mushrooms. Both raw cultivated and wild mushrooms had wide ranging ergosterol contents (7713–17,273 μg/100 g edible portion, EP). Lung oyster mushroom and termite mushroom contained high levels of vitamin D2 (15.88 ± 7.31 and 7.15 ± 0.67 μg/100 g EP, respectively), while other mushroom species had negligible amounts (0.06 to 2.31 μg per 100 g EP). True retention (TR) levels of vitamin D2 after boiling, stir-frying, and grilling were not significantly different (p> 0.05) (with estimated marginal means ± standard error 64.0 ± 2.3%, 58.8 ± 2.3%, and 64.7 ± 3.6% TR, respectively). Consuming cooked lung oyster mushrooms, in particular, along with regular exposure to sunlight should be promoted to reduce the incidence of vitamin D deficiency.