In this paper, a visible light communication based three dimensional indoor positioning system employing a dedicated algorithm and using the code division multiple access technique is proposed to solve the mutual interference among the reference source points. The light signal emitted from a CDMA modulated white LED, carrying LED's position information, is received by positioning terminal through intensity modulation and direct detection, and then the position of the terminal can be estimated based on the RSS-three dimensional localization algorithm. By using the orthogonality of the spreading codes, the separation of the overlap among visible identification code in time domain and frequency domain can be realized. According to the identification information, the position can be located in the associated area. And the precise location is calculated with a novel three dimensional positioning algorithm, based on the signal attenuation. The simulation results show that the proposed location algorithm has a high accuracy of under 7.06 cm and with an average positioning error of about 3.18 cm when the SNR is 30 dB. A real-time small positioning system was also demonstrate to test the performance of the system, which has a very good positioning accuracy. The proposed positioning algorithm is simple and does not require synchronization processing any more. These features outperform other existing indoor wireless localisation approaches.