Nonlinear dielectrics such as ferroelectrics, relaxors and frequency-tunable capacitors are desired to be handled in circuit simulators such as the SPICE. We have developed a software package to simulate a wide variety of nonlinear dielectrics in the SPICE. In the simulation of the polarization vs. electric field curve (P-E curve), the program code ''P-E simulator'' divided the P-E curve into two parts, a nonlinear dielectric part and a domain-switching part. In the former, the polarization was calculated as a linear expansion in terms of electric field, while in the latter, the polarization due to domain switching was calculated by assuming that the distribution of domain-switching probability was represented by Gaussian distribution functions. Two Gaussian distribution functions were required to accurately simulate the P-E curves of ferroelectric materials with the 180-degree and the non-180-degree domains. A circuit model with two capacitors and an arbitrary voltage source was proposed for a macromodel of nonlinear dielectrics in the SPICE. The netlist data to the SPICE were automatically generated using the program code ''Mk-netlist'' from the parameters determined using the P-E simulator. The P-E curves of a PZT thin film and multilayered ceramics capacitors were successfully simulated in the SPICE without the trial-and-error process.