The clinical use of amphotericin B (AmB), a polyene macrolide antifungal drug, is limited due to its poor bioavailability and pronounced cytotoxicity. Cyclodextrin (CD)-based drug carriers have proven to overcome these shortcomings. In the present contribution, the assembly of AmB with β-CD and γ-CD was investigated systematically using molecular dynamics simulations and free-energy calculations, showing that only the polyene macrolide ring could be included in CDs. The potentials of mean force (PMF) that delineate the process of the macrolide ring entering the cavity of a CD following two possible orientations were determined, revealing distinct inclusion modes for the two CDs. AmB was found to possess two sites within its prolonged macrolide ring where it will bind γ-CD, thereby forming stable complexesone located at one end of the ring, the other close to the polar head of the drug. Conversely, the macrolide ring cannot enter the cavity of β-CD due to the limited available space. When AmB approaches γ-CD from its primary rim, the AmB:γ-CD complex corresponding to the first binding site was estimated to be energetically favored. Comparison of the free-energy landscapes characterizing the two CDs reveals that γ-CD possesses significantly higher binding affinity to AmB than β-CD, which may explain the experimental observation of their distinct ability to enhance the bioavailability of AmB. Moreover, decomposition of the PMFs into physically meaningful free-energy contributions suggests that van der Waals and electrostatic interactions constitute the main driving forces responsible for the formation of the CD inclusion complexes.