A bag of rice weighs 1 1/3 times as much as a bag of sugar. Their average mass is 21 kg. What is the mass of the bag of sugar?

Let's assume the mass of the bag of sugar is x kg.

Thus, the mass of the bag of rice is 1 1/3 * x = (4/3)x kg.
The average mass of the two bags is (x + (4/3)x)/2 = (7/3)x/2 = (7/6)x kg.
Given that the average mass is 21 kg, we have (7/6)x = 21 kg.
Multiplying both sides of the equation by 6/7 gives x = (6/7)*21 = 18 kg.
Therefore, the mass of the bag of sugar is 18 kg. Answer: \boxed{18}.