The U.S. Department of Agriculture (the USDA) estimates that there are around 27 grams of carbohydrates in a medium-sized banana. (That "medium-sized" banana weighs 120 grams with the skin is on, or around seven to eight inches in length.)
Three further components are identified from those 27 grams: sugar, fiber, and starch. Within the banana, there are 14.4 grams of total sugar, consisting mostly of three different forms of sugar: fructose, glucose, and sucrose.
There's a fairly significant difference between the overall sugar content of the banana and what you would get in a can of ordinary soda.
In contrast to the sugary beverage, the starch and fiber in the banana are complex carbs that actually slow down the body's absorption of the sugars. This results in a slower and less dramatic rise in blood sugar.
Because of this, bananas are considered to have a low Glycemic Index on the Harvard University public health blog. The rate at which a certain food can raise your blood glucose levels overall is measured using a scale called the Glycemic Index.
The shift that happens when bananas ripen is one more thing to consider about the overall sugar level. The starch content of bananas that are just starting to mature will be higher; as they ripen, the starch will progressively change to sugar.
The ripest bananas would thus have the largest sugar content, which makes sense given the richer flavor that emerges through that speckled peel.