IR Protocols & Codes
The encoding standards that make infrared remote control possible — NEC, Sony SIRC, Philips RC5/RC6, Samsung, and more.
NEC Protocol
The NEC protocol is the most widely used IR encoding standard, developed by NEC in 1980. It is used by the vast majority of Asian-manufactured consumer electronics including TVs, DVD players, air conditioners, and set-top boxes.
- Carrier: 38kHz
- Bits: 32 (8-bit address + 8-bit address inverse + 8-bit command + 8-bit command inverse)
- Encoding: Pulse distance — 562.5μs burst, 562.5μs space = "0", 562.5μs burst, 1687.5μs space = "1"
- Address: 8-bit device address (0-255), sometimes extended to 16-bit
- Repeat: 9ms leader + 2.25ms space (no data) sent every 108ms
NEC Key Codes by Manufacturer
| Manufacturer | Device | Address | Power | Vol+ | Vol- | Ch+ | Ch- |
|---|---|---|---|---|---|---|---|
| LG | TV | 0x04 | 0x08 | 0x02 | 0x03 | 0x00 | 0x01 |
| LG | DVD | 0x07 | 0x08 | 0x02 | 0x03 | 0x00 | 0x01 |
| Samsung | TV (alternate) | 0x07 | 0x02 | 0x07 | 0x0B | 0x12 | 0x10 |
| Hisense | TV | 0x00 | 0x12 | 0x02 | 0x03 | 0x00 | 0x01 |
| TCL | TV | 0x04 | 0x08 | 0x02 | 0x03 | 0x00 | 0x01 |
| Vizio | TV | 0x04 | 0x08 | 0x02 | 0x03 | 0x00 | 0x01 |
| Sony | AV Receiver | 0x06 | 0x12 | 0x12 | 0x13 | 0x10 | 0x11 |
Sony SIRC Protocol
Sony's proprietary IR protocol, used exclusively on Sony TVs, projectors, and AV equipment. Unlike NEC, SIRC uses pulse width encoding and has a distinctive 20-bit format.
- Carrier: 40kHz (not 38kHz)
- Bits: 12 or 20 (5-bit address + 7-bit command, extended to 20-bit)
- Encoding: Pulse width — 600μs = "0", 1200μs = "1"
- Leader: 2400μs burst + 600μs space
Sony SIRC Key Codes
| Device | Address | Power | Vol+ | Vol- | Ch+ | Ch- |
|---|---|---|---|---|---|---|
| TV | 1 | 0x15 | 0x12 | 0x13 | 0x10 | 0x11 |
| DVD/Blu-ray | 2 | 0x15 | 0x12 | 0x13 | 0x10 | 0x11 |
| AV Receiver | 4 | 0x15 | 0x12 | 0x13 | 0x10 | 0x11 |
| Projector | 7 | 0x15 | 0x12 | 0x13 | 0x10 | 0x11 |
Philips RC5 Protocol
Developed by Philips in 1986, RC5 is the dominant IR protocol in Europe. It is used by Philips, Marantz, and many European AV manufacturers. RC5 uses Manchester encoding, making it more robust against noise than pulse-distance encoding.
- Carrier: 36kHz
- Bits: 14 (1 start + 1 toggle + 5 address + 6 command)
- Encoding: Manchester — transition in middle of bit period: low-to-high = "1", high-to-low = "0"
- Bit time: 1.778ms per bit
RC5 Key Codes
| Device | Address | Power | Vol+ | Vol- | Ch+ | Ch- |
|---|---|---|---|---|---|---|
| TV | 0 | 0x0C | 0x10 | 0x11 | 0x20 | 0x21 |
| DVD | 1 | 0x0C | 0x10 | 0x11 | 0x20 | 0x21 |
| Satellite | 4 | 0x0C | 0x10 | 0x11 | 0x20 | 0x21 |
| Amplifier | 5 | 0x0C | 0x10 | 0x11 | 0x20 | 0x21 |
RC6 Protocol
RC6 is an extension of RC5 developed by Philips, supporting longer command fields and multi-bit addressing. It is widely used for Microsoft MCE (Media Center) remotes and modern Philips equipment.
- Carrier: 36kHz
- Bits: 16-32 (mode field allows variable length)
- Encoding: Manchester with double-width start bit
- Notable: Used by Microsoft Windows Media Center remotes
Samsung Protocol
Samsung uses its own variant of the NEC protocol with a 32-bit format. While similar in structure to NEC, Samsung uses different timing parameters and a distinctive leader code.
- Carrier: 38kHz
- Bits: 32 (8-bit device + 8-bit sub-device + 8-bit command + 8-bit command inverse)
- Leader: 4.5ms burst + 4.5ms space (longer than NEC's 9ms)
- Encoding: Pulse distance — 560μs burst, 560μs space = "0", 560μs burst, 1690μs space = "1"
Samsung Key Codes
| Device | Address | Power | Vol+ | Vol- | Ch+ | Ch- |
|---|---|---|---|---|---|---|
| TV | 0x07 | 0x02 | 0x07 | 0x0B | 0x12 | 0x10 |
| Soundbar | 0x0E | 0x02 | 0x07 | 0x0B | 0x12 | 0x10 |
| Blu-ray | 0x08 | 0x02 | 0x07 | 0x0B | 0x12 | 0x10 |
Other Notable Protocols
- JVC: Uses a modified NEC protocol with inverted carrier (active low).
- Denon: Similar to NEC but with 24-bit address extension.
- Sharp: Uses pulse distance with different timing than NEC (132μs short, 339μs long).
- Motorola: Similar to RC5 but with different bit timing.
- Panasonic: Uses NEC-like protocol with 48-bit extended addressing.
- Yamaha: Uses RC5-compatible protocol with Yamaha-specific addresses.
Finding Your Device's IR Codes
To find the exact IR codes for your specific device, use one of these resources:
- IRDB (GitHub): The most comprehensive open-source IR code database, organized by manufacturer and device type. Search by model number.
- LIRC: Linux Infrared Remote Control project maintains a large collection of IR code files.
- ProntoCoded: Community-maintained database of Pronto-format IR codes.
- Global Cache: Commercial IR database with codes verified for their hardware.
- Learning Remote: Use a universal learning remote or IR receiver to capture codes directly from your original remote.