Abstract We propose a possible unified model of short and long gamma-ray bursts (GRBs), X-ray rich GRBs, and X-ray flashes. The jet of a GRB is assumed to consist of multiple sub-jets or sub-shells (i.e., an inhomogeneous jet model). The multiplicity of the sub-jets along a line of sight n s is an important parameter. If n s is large (≫1) the event looks like a long GRB, while if n s = 1, the event looks like a short GRB. Finally, when n s = 0, the event looks like an X-ray flash or an X-ray rich GRB. Furthermore, our model may also explain the bimodal distributions of T 90 duration of BATSE-GRBs.