If you are faced with a choice between connecting your home theater or sound system with either optical audio or HDMI, it may be unclear which will provide the best sound. Both optical audio and HDMI support multi-channel audio, like Dolby Digital, but HDMI is capable of transmitting slightly higher quality than optical. Whichever you choose, both of these connections are usually preferable to analog connections like RCA connections.
Optical cables use light to transmit the digital audio signal from the source device to the receiver. The receiver then translates that signal, which carries the information for all of the different speakers, into single streams of information that the speakers can produce as sound. Because of the digital nature, if the cord has a proper connection, the information communicated is always the same, and the sound information distributed to the speakers will also always be the same.
High Definition Media Interface, or HDMI, transmits digital audio and video at the same time through the same cable. HDMI is ideal for connecting a Blu-ray or DVD player to an HDTV. HDMI can provide slightly better audio transmission than optical audio. HDMI cables are quite inexpensive. However, not all audio systems have an HDMI interface.
The quality difference between these two cables depends largely on the speaker set-up used. 5.1 speakers is the most standard household surround, if people use it at all. Optical cords are perfectly capable of distributing 5.1 surround at perfect digital translation, despite their use of light to distribute the information. Still, they are not fast enough to be able to distribute much more than that.
For high-definition sound or for more speakers, like a 7.1 surround sound system, the cable has to transfer more data. HDMI is better in these circumstances than optical audio. HDMI also supports high-definition formats like Dolby TrueHD and DTS HD Master Audio, which are both available through the Blu-ray format. Optical audio does not support either of these formats.
HDMI is completely lossless, so people won't be losing any audio, and the difference is clear. HDMI is the only cable currently with this status. However, most audiophiles with a layman's budget will not have the equipment necessary to differentiate between the minute differences in sound quality between optical audio and HDMI. Every home theater has a slightly different need, but if your system supports HDMI, this should be your first choice.