The efficient calculation of induced charges in an inhomogeneous dielectric is important in simulations and coarse-grained models in molecular biology, chemical physics, and electrochemistry. We present the induced charge computation (ICC) method for the calculation of the polarization charges based on the variational formulation of Allen et al. [Phys. Chem. Chem. Phys. 3, 4177 (2001)]. We give a different solution for their extremum condition that produces a matrix formulation. The induced charges are directly calculated by solving the linear matrix equation Ah=c, where h contains the discretized induced charge density, c depends only on the source charges-the ions moved in the simulation-and the matrix A depends on the geometry of dielectrics, which is assumed to be unchanged during the simulation. Thus, the matrix need be inverted only once at the beginning of the simulation. We verify the efficiency and accuracy of the method by means of Monte Carlo simulations for two special cases. In the simplest case, a single sharp planar dielectric boundary is present, which allows comparison with exact results calculated using the method of electrostatic images. The other special case is a particularly simple case where the matrix A is not diagonal: a slab with two parallel flat boundaries. Our results for electrolyte solutions in these special cases show that the ICC method is both accurate and efficient.