6. Three equal cylinders are pairwise tangent, and their axes are mutually perpendicular. If the radius of the base of each cylinder is equal to $r$, then the radius of the smallest sphere that is tangent to all three cylindrical surfaces is $\qquad$ .
6. $\sqrt{2} r-r$.

Construct a cube $A B C D-A_{1} B_{1} C_{1} D_{1}$ with edge length $2 r$, where edge $A A_{1}$ lies on the axis of the first cylinder, edge $D C$ lies on the axis of the second cylinder, and edge $B_{1} C_{1}$ lies on the axis of the third cylinder. Since $A A_{1}, D C, B_{1} C_{1}$ are mutually perpendicular, they meet the problem's requirements.

Let the center of the cube be $O$. The distance from $O$ to $A A_{1}, D C, B_{1} C_{1}$ is
$$
\frac{1}{2}|A C|=\frac{1}{2} \times 2 \sqrt{2} r=\sqrt{2} r .
$$

Therefore, the sphere with center $O$ and radius $\sqrt{2} r-r$ is tangent to the three cylinders and is the smallest sphere that can do so.