Opto-isolator
devices may be used for voltage level-shifting purposes. Below are
examples of level-shifting circuits that utilize opto-isolators (one
non-inverting and one non-inverting).

Figure 1. Non-inverting
Voltage Level Shifter using an Opto-Isolator
Figure 1
shows an opto-isolator that's configured as a
non-inverting voltage level shifter (5V to 12V). When the input is high
(close to 5V), the light-emitting diode does not conduct. With no light
shining on the phototransistor, it is also off, causing the
collector-tapped output to be very near 12V. When the input is low
(close to 0V), the LED conducts, shining light on the phototransistor.
The transistor turns on and pulls the output to ground.