  We present a simple technique to calculate spin-orbit coupling, $\langle {\bf
L}\cdot{\bf S} \rangle$, and branching ratio measured in x-ray absorption
spectroscopy. Our method is for first-principles electronic structure
calculation and its implementation is straightforward for any of standard
formulations and codes. We applied this technique to several different large
spin-orbit coupling iridates. The calculated $\langle{ {\bf L}\cdot{\bf S}}
\rangle$ and branching ratio of a prototype $j_{\rm eff}$=1/2 Mott insulator,
Sr$_2$IrO$_4$, are in good agreement with recent experimental data over the
wide range of Rh-doping. Three different double perovskite iridates (namely,
Sr$_2$MgIrO$_6$, Sr$_2$ScIrO$_6$, and Sr$_2$TiIrO$_6$) are also well described.
This technique can serve as a promising tool for studying large spin-orbit
coupling materials from first-principles and for understanding experiments.
