This optical switch includes: input ports; output ports; and a spatial light modulating unit to which an optical signal from an input port is incident and which deflects the optical signal to a selected output port. A phase distribution is set in the spatial optical modulating unit so that a phase distribution for a radius of curvature that is the same as the radius of curvature of a wave surface of incident light is superimposed on a phase distribution for connecting the deflected optical signal with the output port.