We define the virtual infinite capacitor (VIC) as a nonlinear capacitor that has the property that for an interval of the charge Q (the operating range), the voltage V remains constant. We propose a lossless approximate realization for the VIC using a switched power converter and capacitors. This circuit is simple but it requires a complex control algorithm that we describe. There are two controllers needed to operate a VIC: the voltage controller acts fast to maintain the desired terminal voltage, while the charge controller acts more slowly and maintains the charge Q in the desired operating range by influencing the incoming current. The VIC is useful as a filter capacitor for various applications, for example power factor compensators (PFC), as we describe. In spite of using small capacitors, the VIC can replace a very large capacitor in applications that do not require substantial energy storage. We give simulation results for a PFC working in critical conduction mode with a VIC for output voltage filtering.