We demonstrate an integrated device for optical payload envelope detection and optical label recovery for optical packet switching. The device is designed to handle asynchronous serially labeled packets with variable length 40 Gbps payloads preceded by 10 Gbps labels. The device outputs two signals: 1. a payload envelope signal corresponding to the temporal location and duration of the optical payload and 2. an electrical label recovered from the optical label. The payload envelope signal has rise and fall times of 3 ns with 150 ps RMS jitter and is used to perform error free label erasure and rewriting. Error free label recovery is also demonstrated. (c) 2006 Optical Society of America.