A virtual x-ray diffractometer has been developed and used as a flexible and powerful tool to help undergraduate and graduate students become familiar with the design and operation of the X-ray equipment in visual and interactive ways and learn fundamental principles underlying the analytical x-ray diffraction methods. The diffractometer has been used: for lecture demonstrations, as part of homework and control assignments, for preparing students to a handson work in X-ray labs, in combination with actual X-ray diffractometers, and for performancebased assessment of students’ ability to apply gained knowledge of diffraction theory for solving practical problems. An integrated learning management system and authoring toolkit allow instructors to design new virtual experiments and alter existing ones, create specific learning assignments for students and make learning more personal and meaningful to students.