How is the pregnancy due date calculated?

40 weeks from LMP. The convention is calculating 40 complete weeks from the last normal mentrual period. For assisted conception by any method there are small modifications, but they don't change the basic rule. With uncertain/unknown lmp, dating is estimated by ultrasound measurement of fetal parts and pregnancy structures, but if this agrees within 1 week to lmp, then menstrual dating is still used.