Depending on how the onion is prepared, a cup of raw onions may have fewer onions than a cup of cooked onions. So, cooked onions can have more carbs. It’s best to compare foods by weight though to get a better picture of how the carbs compare.