Ovulation usually happens about 14 days before the next period starts, so the estimate is: first day of last period + cycle length - 14 days. The fertile window is the 5 days before ovulation plus the day of ovulation and the day after, because sperm can survive up to 5 days.
Example: a 28-day cycle starting on the 1st puts ovulation on day 14 (the 15th) and the fertile window from the 10th to the 16th.
It is an estimate for regular cycles only. Stress, illness and irregular cycles move ovulation. It is not birth control and not medical advice; ask a doctor for personal guidance.
A test is most reliable from the day your period is due, which is the "Next period" date shown above.
See also: Due Date Calculator · Sleep Calculator · BMI Calculator