Stationary and on-board battery chargers, methods of charging batteries, electric-vehicle chargers, and vehicles with chargers, including electric vehicles and hybrid electric vehicles. Chargers may automatically charge at the correct battery voltage for various types of batteries. Chargers have variable AC power supplies controlled by digital controllers, isolation transformers, and rectifiers. Transformers may be foil-type, and may have copper foil. Power supplies may be variable-frequency generators and the controllers may control the frequency. Use of the variable frequency generator supply facilitates reduced component size and weight and better battery charging performance. Electric vehicle chargers may have card readers, and vehicles may have batteries and a charger. Methods of charging include identifying the battery type and gradually increasing the charging at different rates of increase while monitoring charging voltage, charging current, or both, until a current lid is reached. Charging may occur at constant current and then at constant voltage.