An indoor positioning algorithm is presented that uses a single rectangular visible light communication (VLC)-modulated LED as a transmitter and the CMOS image sensor of a smartphone camera as a receiver. The real-world location of the LED is transmitted as a VLC signal that is decoded by the smartphone using optical camera communication (OCC). Then the location of the smartphone is calculated by finding the camera pose using the perspective-n-point algorithm on the real-world coordinates and corresponding image coordinates of the LED. The algorithm is experimentally evaluated as a real-time application running on a smartphone. The experimental results show that the algorithm can achieve an average 3D positioning error of less than 5 cm for an arbitrarily tilted smartphone.