4. $\frac{\sqrt{2}(1+\ln \ln 2)}{\ln 2}$.

Let $P\left(a, 2^{a}\right), Q\left(b, \log _{2} b\right)$, such that $|P Q|$ is minimized.
Since $y=2^{x}$ and $y=\log _{2} x$ are inverse functions, the slopes of the tangent lines at points $P$ and $Q$ are both 1, and the slope of the line $P Q$ is -1. Therefore,
$$
\begin{array}{l}
2^{a}=b=\frac{1}{\ln 2}, \\
|P Q|=\sqrt{2}|a-b|=\frac{\sqrt{2}(1+\ln \ln 2)}{\ln 2} .
\end{array}
$$
4. Let points $P$ and $Q$ be on the graphs of the functions $y=2^{x}$ and $y=\log _{2} x$, respectively. Then the minimum value of $|P Q|$ is $\qquad$