A rapid and simple immunoassay and a sol–gel-based immunoaffinity chromatography (IAC) purification method for Rhodamine B (RB) were developed using spiked chilli powder. A polyclonal antibody against RB was generated by immunisation of rabbits with an immunogen hapten. An enzyme-linked immunosorbent assay (ELISA) was developed that achieved a 50% inhibition (IC50) value of 0.94 ± 0.05 ng mL−1. The limit of detection of the ELISA method was 1 ng g−1 in chilli powder. For the IAC, recovery was 68.1–86.2% at 1 ng g−1 and 72.6–89.3% at 5 ng g−1 in spiked chilli powder. Fortified samples were analysed by high performance liquid chromatography–mass spectrometry (HPLC–MS) after IAC purification, and the results showed a good agreement between the two methods. The ELISA could be a convenient tool for screening RB residue in foods, and the IAC cleanup procedure coupled with HPLC–MS could be an effective alternative method for the determination of RB in various substances.