We design downlink precoder for the massive MIMO system compensating I/Q imbalance at both base station (BS) and user terminals (UTs). I/Q imbalance is one of the most important hardware impairment issue of wireless system and causes distortion of constellation and degrades error probability and transmission rate significantly. Since I/Q imbalance which is occurred in both BS and UTs cannot compensated perfectly by the conventional regularized zero-forcing precoder, we formulated the optimization problem and solve it with massive MIMO assumption. We evaluate performances of proposed precoder by simulation and show that the sum rate of proposed precoder can achieve the sum rate of ideal hardware without I/Q imbalance. In addition, the proposed precoder shows better BER performance than the conventional precoder.