An electrodeposition method was applied to form gold–platinum (AuPt) alloy nanoparticles on the glassy carbon electrode (GCE) modified with a mixture of an ionic liquid (IL) and chitosan (Ch) (AuPt–Ch–IL/GCE). AuPt nanoparticles were characterized by X-ray diffraction (XRD), scanning electron microscopy (SEM) and electrochemical methods. AuPt–Ch–IL/GCE electrocatalyzed the reduction of H 2O 2 and thus was suitable for the preparation of biosensors. Cholesterol oxidase (ChOx) was then, immobilized on the surface of the electrode by cross-linking ChOx and chitosan through addition of glutaraldehyde (ChOx/AuPt–Ch–IL/GCE). The fabricated biosensor exhibited two wide linear ranges of responses to cholesterol in the concentration ranges of 0.05–6.2 mM and 6.2–11.2 mM. The sensitivity of the biosensor was 90.7 μA mM −1 cm −2 and the limit of detection was 10 μM of cholesterol. The response time was less than 7 s. The Michaelis–Menten constant ( K m) was found as 0.24 mM. The effect of the addition of 1 mM ascorbic acid and glucose was tested on the amperometric response of 0.5 mM cholesterol and no change in response current of cholesterol was observed.