There is a tariff of 13% when converting U.S. dollars to Cuban convertible pesos (CUCs) while in Cuba. This fee can vary from place to place and is subtracted from the exchange at the time of conversion.
In Cuba, exchange your money at the airport, a CADECA exchange kiosk. CADECA is an official money exchange agency in Cuba. Do not exchange money on the street or in unknown situations.
Please note that CUCs are not available for exchange outside of Cuba. You must exchange your currency to CUCs upon arrival in Cuba. Likewise, if you have excess CUCs upon departure, you must convert them before you leave Cuba.
Please see the update as of December 2019 here regarding the use of U.S. dollars in Cuba.