We present a simple technique to calculate spin-orbit coupling, < L.S >, 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 the standard formulations and codes. We applied this technique to several different large spin-orbit coupling iridates. The calculated < L.S > and branching ratio of a prototype j(eff) = 1/ 2 Mott insulator, Sr2IrO4, are in good agreement with recent experimental data over the wide range of Rh doping. Three different double-perovskite iridates (namely, Sr2MgIrO6, Sr2ScIrO6, and Sr2TiIrO6) 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