Applications on Location Based Services (LB-Ss) have attracted significant attention due to its personalized, convenient, and smart user experience, and meanwhile the accurate mapping and localization algorithm plays a crucial role in satisfying the LBSs. At the same time, motivated by the widely-deployed Wi-Fi network, the Wi-Fi signal based localization has become one of the superior positioning techniques in indoor environment, and the corresponding sample capacity involved in positioning database establishment should be given much attention due to its significant guidance meaning in practice. In this paper, we propose a new sample capacity optimization approach for indoor Wi-Fi localization from the information theoretic view, namely Sample Capacity Optimization for Positioning database Establishment (SCOPE) in indoor Wi-Fi environment. Interestingly, we analogize the positioning database establishment process in indoor Wi-Fi environment into the information propagation process in a lossy channel, and meanwhile formulate the relations between the sample capacity and localization error. Experimental result shows that the proposed SCOPE can accurately estimate the minimum sample capacity with a given expected localization accuracy under different Access Point (AP) combination.