If you look on any nutrition label in the US, you see it shows you the total carbohydrates in that food item. This is regulated by the FDA. Just how is that value determined?
To start with, of course, there is a regulation. The FDA Regulation says:
(6) "Carbohydrate, total" or "Total carbohydrate": A statement of the number of grams of total carbohydrate in a serving expressed to the nearest gram, except that if a serving contains less than 1 gram, the statement "Contains less than 1 gram" or "less than 1 gram" may be used as an alternative, or if the serving contains less than 0.5 gram, the content may be expressed as zero. Total carbohydrate content shall be calculated by subtraction of the sum of the crude protein, total fat, moisture, and ash from the total weight of the food. This calculation method is described in A. L. Merrill and B. K. Watt, "Energy Value of Foods--Basis and Derivation," USDA Handbook 74 (slightly revised 1973) pp. 2 and 3, which is incorporated by reference in accordance with 5 U.S.C. 552(a) and 1 CFR part 51 (the availability of this incorporation by reference is given in paragraph (c)(1)(i)(A) of this section).
It's important to understand a bit of biology to understand this. There are four main types of fuel the human body is physically capable of burning. These are:
We'll ignore alcohol for now since that would fall under the BATF regulation :) That leaves us with fats, proteins, and carbohydrates. In essence what this regulation is saying is
"Look at the food item. Subtract out the proteins and fats. Then ignore water, which has no calories, and ash, which is already burnt and therefore has no calories. Whatever is left MUST be carbohydrates."
So this technique leaves everything in the "carbohydrate category" as falling into that total area. That includes starches, sugars, fibers, and sugar alcohols.
Below that sometimes a label breaks out this total carb count even further - it can show the break-out of dietary fiber, soluble fiber, insoluble fiber, sugars, sugar alcohols, and "other carbohydrates". Of these, only the dietary fiber and sugars are required if they are greater than zero. The others are voluntary.
I have many examples of labels on this site, read the below article to learn more!
Lisa Shea's Library of Low Carb Books