Light-emitting diodes (LEDs) are changing indoor wireless communications. Visible light communications (VLC) that use LEDs as transmitters is an emerging research area and has significant commercial potential. The light emitted from LEDs can simultaneously carry information and provide illumination. Due to the intrinsic characteristics of light, VLC is more secure, more power efficient, and can provide higher network data transmission rates than radio frequency communications. This paper describes state-of-the-art VLC systems including transmitters, receivers, and channel models. Modulation and networking algorithms for physical layer and cross-layer designs are discussed. These algorithms are designed considering practical constraints, such as the bandlimited channel, illumination requirements, and transmitted power limitations. Indoor localization algorithms are proposed, with a particular focus on fingerprinting. In addition, this paper introduces practical applications of VLC in many fields such as national defense, healthcare, robotics, and vehicle-to-vehicle communications. The paper concludes with a discussion of the challenges, opportunities, and future of VLC.