Let \( x \) be the total number of eggs in the box. According to the problem, 30% of the eggs were cracked, and we know that the number of cracked eggs is 42. This gives us the equation:
\[ 0.30x = 42 \]
To find \( x \), we can solve for it by dividing both sides of the equation by 0.30:
\[ x = \frac{42}{0.30} \]
Calculating the right-hand side:
\[ x = \frac{42}{0.30} = 42 \div 0.30 = 42 \times \frac{100}{30} = 42 \times \frac{10}{3} = 140 \]
Thus, the total number of eggs in the box is
\[ \boxed{140} \]