Given the increasing healthcare costs of an ageing population, there is growing interest in rational prescribing, which takes costs of medication into account. We aimed to gain insight into the attitude to and knowledge of medication costs of medical students and doctors in daily practice. This was a cross-sectional electronic survey among medical students (bachelor/master) and doctors (consultants/registrars). Attitude to costs was evaluated using a cost-consciousness scale. In open questions, the participants estimated the cost of commonly prescribed (generic/non-generic) drugs (including separate pharmacy dispensing costs). They were asked where they could find information about drug costs. Overall, a reasonable cost-consciousness was found. Students were less conscious of the cost than were doctors (15.56 SD 3.25 versus 17.81 SD 2.25; scale 0-24; p = 0.001). In contrast to this consciousness, actual estimated drug costs were within a 25% margin for only 5.4% of generic and 13.7% of proprietary drugs (Wilcoxon signed-rank, p < 0.001). The price of generic drugs was frequently overestimated (77.5%) and that of proprietary drugs was underestimated (51.4%). The dispensing costs were estimated correctly for 30% of the drugs. Most doctors (84%) and a minority of students (40%) were able to identify at least one source of information about drug costs. While doctors and students considered it important to be aware of the cost of drugs, this attitude is not reflected in their ability to estimate the cost of frequently prescribed drugs. Cost awareness is important in therapeutic reasoning and cost-effective prescribing. Both should be better addressed in (undergraduate) pharmacotherapy education.