We prove that quantum random access code (QRAC) performs better than its classical counterpart only when incompatible quantum measurements are used in the decoding task. As a consequence, evaluating the average success probability for QRAC provides a semi-device independent test for the detection of quantum incompatibility. We further demonstrate that any incompatible pair of projective measurements gives an advantage over all classical strategies. Finally, we establish a connection between the maximal average success probability for QRAC and earlier quantities introduced to assess incompatibility.