He was the son of Anna van der Meij and Christiaan Hartsoeker (1626–1683), a Remonstrant minister in Moordrecht near Gouda. His father took the family to Alkmaar in 1661 and finally to Rotterdam in 1669. Nicolaas started to make a living as a lens maker in Rotterdam, and was instructed in optics by Antoni van Leeuwenhoek. In 1674, he and a fellow student, assisted by Van Leeuwenhoek, were the first to observe semen, a situation that would later lead to a priority dispute between Hartsoeker and Leeuwenhoek over the discovery of spermatozoids.
In 1677, Hartsoeker met Christiaan Huygens and initiated him in the making of lenses. In June 1678, Hartsoeker accompanied, in the role of an assistant, Huygens on a trip to Paris, where they made a great impression with their microscopes. Huygens failed to mention Hartsoeker even once in a subsequent publication in France however, leading to a fall-out between the two.
Hartsoeker returned to Rotterdam, where his parents still lived and where he married Elisabeth Vettekeucken in October 1680. His business as an instrument maker and wine merchant failed and, after the death of his father in August 1683, he moved his family in 1684 to Paris, where he made instruments for the Paris observatory and the academy. Hartsoeker also came up with contrivances for aiming very large aerial telescopes originally popularized by Huygens. He remained there until 1698.
It is often said that in 1694, while observing human sperm through a microscope, Hartsoeker believed that he saw tiny men inside the sperm, which he called homunculi or animalcules. However, he only postulated their existence as part of his Spermist theory of conception and never claimed to have seen them. The 1694 "Essay on dioptrics", in which this hypothesis appears, was a highly-lauded book, in fact tackling several misconceptions of the time. For example, Hartsoeker disavows the contemporary position (e.g. of Robert Hooke) that with refractor telescopes one soon would be able to see man-sized creatures on the moon, if any in fact existed.
At the end of the century, Hartsoeker had become quite famous. In 1699 he was elected member of the French Academy of Sciences and in 1704 of the Prussian Academy of Sciences, in both cases as one of the first foreign members. Czar Peter met him in Amsterdam and offered him the chair of mathematics in St Petersburg. Hartsoeker did not accept, but the czar did finance an observatory for him in Amsterdam. Later, in 1704, Hartsoeker accepted the offer of Johann Wilhelm, Elector Palatine to become "first mathematician and honorary professor of philosophy" at the University of Heidelberg. The last years of his life were spent in Utrecht.
- Essai de dioptrique, 1694.
- Principes de physique, 1696.
- Traité de physique, 1696.
- Davidson, Michael W. "Hartsoeker Screw-Barrel Microscope". Microscopy Primer: Museum of Mircoscopy. Florida State University.
- Dijksterhuis, Fokko Jan (2007). "Constructive thinking: a case for dioptrics". In Roberts, Lissa; Schaffer, Simon; Dear, Peter. The Mindful Hand: inquiry and invention from the late Renaissance to early industrialisation. Koninklijke Nederlandse Akademie van Wetenschappen. pp. 59––82. ISBN 978-90-6984-483-1.
- Hartsoeker, Nicolaas (1710). "Nova methodus utendi vel" (in latin). Miscellanea Berolinensia ad incrementum scientiarum, ex scriptis Societati Regiae Scientiarum exhibitis edita i: 261–262.
- Hill, K.A. (1985). "Hartsoeker's Homonculus: a corrective note". Journal of the History of the Behavioral Sciences 21 (2): 178–179. doi:10.1002/1520-6696(198504).