When tracking macros and calories or gauging portion sizes, whether you should be weighing food raw or cooked is important to consider. The nutrient content of 4 ounces of raw beef and 4 ounces of cooked beef is NOT the same and can cause some large discrepancies in perceived calorie and nutrient intake, especially with foods that are consumed fairly frequently.
In most cases, it's absolutely going to be best and the most accurate to weigh food raw. Depending on the food, food will change density pretty drastically during the cooking process. Exactly how much it changes will depend on the cooking method, cooking time, temperature, etc. so it's difficult to come up with an exact general conversion for what a given raw amount of food should weigh when it's cooked, every time. It will vary from case to case.
Unless otherwise specified, nutrition labels will yield the nutrition information for the weight of the food as is. If you are buying food in a pre-cooked package, you don't have to worry about the weight before it was prepared and cooked. You would weigh it straight out of the package and eat it. If you're preparing your own food, however, there are some other things to consider. Let's take meat, for example. Most of the time, you are buying your meat raw (or frozen) in a package. The nutrition information listed on the package is for the indicated weight of the meat as is (raw). It's very common for people to cook their meat and THEN weigh out their desired portion, for example, 4 ounces. But the nutrition information entered is usually going to be for 4 ounces of the raw meat, which will yield much less (weight wise) once the meat is cooked. If the meat yields 4 ounces cooked, it's actually probably closer to 5 or 6 ounces (raw weight). This difference of a few hundred calories will certainly add up over the course of the day, week and month across all of your meals. This could easily create a problem and lead to one thinking they are eating less than they actually are. So, weigh your meat raw for accurate portion sizing. That's great, if you are only cooking one portion. But what if you are cooking in bulk or making a meal for multiple people at once? You have a few options here.
First, let's go over the most accurate (though a bit more tedious and time consuming) way to calculate the weight of cooked meat; to weigh before and after. For example, if you have a 2lb (24 ounce) package of chicken that you're baking all at once, you weight the meat before cooking (yielding 24 ounces). Then, once the meat is done cooking, weigh the meat again. Let's say it weighs 16 ounces after it's cooked. Now, you want to find out how much of the cooked meat you should measure out if you want an ounce (raw/true weight) of meat. To do this, you would take 16 (ounces cooked) and divide it by 24 (ounces raw). This comes out to about .67. This means that for every one ounce of meat you want to dish up, you should weigh out .67 ounces of cooked meat (a 4 ounce serving of meat would then be 2.68 ounces. See why it matters?). Remember that cooked weight will vary on an individual basis, so it wouldn't be accurate to say that 2.68 ounces of cooked meat will always yield 4 ounces of raw (true weight) meat. This process should be repeated each time you cook for the most accurate results. The above would be the ideal way to get the most accurate results. However, sometimes it may not be feasible for whatever reason. If this is the case, you can also estimate. As a rule of thumb, meat usually loses about 25-30% of its weight in the cooking process. If you are eating meat that you didn't cook (so couldn't weigh raw), or you couldn't weigh and generate the exact calculations for whatever reason, you can assume that every ounce of meat you want should yield about 0.7-0.75 ounces of cooked meat.
There are some foods that will actually increase in weight during the cooking process such as pasta, rice and other grains. Again, it will be the most accurate to weigh these foods raw.
Let's use rice as our example here. A serving on the package is indicated as 1/4 cup or 47 grams (dry weight). If you're cooking for one, you can simply cook this amount of rice to yield one serving. If you're cooking in a larger batch, you can weigh the total amount of rice before and after cooking again. Let's say you are cooking 235 grams (raw) of rice, or 5 servings. After you cook the rice, it weighs about 660 grams. So, to yield one 1/4 cup (raw measurement) serving of rice as per the nutrition label, you would need to take 660 and divide it by 5, which is 132 grams of cooked rice per serving.
It's far more common for things that absorb water in the cooking process, like grains and legumes, to be measured by volume vs weight. This may be more acceptable for these food items as there isn't quite as much of a discrepancy in weight or volume across cooking methods. If you were to look up the nutrition information for 1 cup of rice, that's typically going to be for 1 cup of cooked rice unless otherwise specified. The same would apply to most other foods that absorb water when cooked. This is a perfectly fine way to measure portions for these foods as well. It won't be quite as exact or accurate as the aforementioned method, but the discrepancies will be far less than that of meat (and other foods that lose water in the cooking process) and oftentimes it may be more practical to measure this way for these foods. As you can see, the cooking process can drastically change the weight or volume of foods in a variety of ways. For this reason, it's going to be the most accurate and standardized to weigh and calculate nutrition information based on the raw weight of foods. If you aren't able to do that, there are some general formulas you can use to make fairly educated estimates about your portion sizes, even if they aren't perfect. The most important thing is that you stay consistent and try to be as accurate as you can be whenever you can be.