2. Let $A$ and $B$ be two sets, and call $(A, B)$ a "pair". When $A \neq B$, consider $(A, B)$ and $(B, A)$ as different pairs. Then the number of different pairs $(A, B)$ that satisfy the condition
$$
A \cup B=\{1,2,3,4\}
$$

is $\qquad$
2. 81.

When set $A$ has no elements, i.e., $A=\varnothing$, set $B$ has 4 elements, there is 1 case; when set $A$ contains $k(k=1,2,3,4)$ elements, set $B$ contains the other $4-k$ elements besides these $k$ elements, the elements in set $A$ may or may not be in set $B$, there are $\mathrm{C}_{4}^{k} \times 2^{k}$ cases.
In summary, the total number of different pairs is
$$
1+\sum_{k=1}^{4} \mathrm{C}_{4}^{k} \times 2^{k}=81
$$