Visible light communication (VLC) based on light-emitting diodes (LEDs) technology not only provides higher data rate for indoor wireless communications and offering room illumination but also has the potential for indoor localization. VLC-based indoor positioning using the received optical power levels from emitting LEDs is investigated. We consider both scenarios of line-of-sight (LOS) and LOS with non-LOS (LOSNLOS) positioning. The performance of the proposed system is evaluated under both noisy and noiseless channel as is the impact of different location codes on positioning error. The analytical model of the system with noise and the corresponding numerical evaluation for a range of signal-to-noise ratio (SNR) are presented. The results show that an accuracy of <10 cm on average is achievable at an SNR > 12 dB.