The answer is both. When determining the pricing, UPS will measure both the dimensional weight and actual weight of the package. Dimensional weight is based on the size of the package. The larger of the two numbers will be used to calculate the shipping cost. So, a small package that is very heavy will likely be calculated using the actual weight. However, a big box that is lightweight might have its shipping charge calculated based on the size of the box.