This paper presents a fast and novel method to determine the optimal capacity of a battery and a hydrogen system for a grid-connected photovoltaic (PV) system based on the required grid dependency (GD) and the minimum Levelized Cost of Energy (LCE). The GD is calculated from the weather data at 9 locations throughout Japan during 25 years considering different sizing of PV, battery, and hydrogen system. Based on the results, the relationship between the GD and the capacities of the devices and the weather parameter is established. The results show that the GD depends on the annual total solar insolation and the devices' capacities as well. The empirical GD formula is then examined at a different location in Japan. The proposed GD calculation agrees well with the GD obtained from the real 25 - year weather data and shows great advantages over the conventional method in the simplicity and calculation time. In addition, the optimal capacity of the system can be obtained directly from the GD formula and the objective function of the LCE. (C) 2017 Elsevier Ltd. All rights reserved.