A medium-sized banana weighing about 118 grams contains 27 grams of carbohydrates, while a cup of sliced banana will be about 34 grams.
Most ketogenic diets recommend less than 50 grams of carbs daily, while some more restrictive diets suggest that 25 to 30 grams are optimal.