Echinocandins and triazoles were proven to be effective antifungal drugs against invasive fungal infections (IFI), which may cause significant morbidity and mortality in immunocompromised patients. The aim of this study was to compare the efficacy and safety between echinocandins and triazoles for the prophylaxis and treatment of fungal infections. PubMed, Embase, and the Cochrane Library were searched to identify relevant randomized controlled trials (RCTs) up to July 2014. The quality of trials was assessed with the Jadad scoring system. The primary outcomes of interest were treatment success, microbiological success, breakthrough infection, drug-related adverse events (AEs), withdrawals due to AEs, and all-cause mortality. Ten RCTs, involving 2,837 patients, were included, as follows: caspofungin versus fluconazole (n = 1), caspofungin versus itraconazole (n = 1), anidulafungin versus fluconazole (n = 1), micafungin versus fluconazole (n = 4), micafungin versus voriconazole (n = 2), and micafungin versus itraconazole (n = 1). Echinocandins and triazoles showed similar effects in terms of favorable treatment success rate [relative risk (RR) = 1.02, 95 % confidence interval (CI), 0.97–1.08], microbiological success rate (RR = 0.98, 95 % CI, 0.90–1.15), breakthrough infection (RR = 1.09; 95 % CI, 0.59–2.01), drug-related AEs (RR = 0.94; 95 % CI, 0.71–1.15), and all-cause mortality (RR = 0.85; 95 % CI, 0.66–1.10) in the prophylaxis and treatment of fungal infections. Additionally, echinocandins were more effective than triazoles for prophylaxis in patients undergoing hematologic malignancies or those who received hematopoietic stem cell transplantation (HSCT; RR = 1.08; 95 % CI, 1.02–1.15). Echinocandins significantly decreased the AE-related withdrawals rate compared with triazoles (RR = 0.47; 95 % CI, 0.33–0.67). This meta-analysis revealed that echinocandins are as effective and safe as triazoles for the prophylaxis and treatment of patients with fungal infections.