Context. NGC 1068 is the most observed radio-quiet active galactic nucleus (AGN) in polarimetry, yet its high-energy polarization has never been probed before due to a lack of dedicated polarimeters. Aims. Using the first X-ray polarimeter sensitive enough to measure the polarization of AGNs, we want to probe the orientation and geometric arrangement of (sub)parsec-scale matter around the X-ray source. Methods. We used the Imaging X-ray Polarimetry Explorer (IXPE) satellite to measure, for the first time, the 2–8 keV polarization of NGC 1068. We pointed IXPE at the target for a net exposure time of 1.15 Ms, in addition to using two Chandra snapshots of ∼10 ks each in order to account for the potential impact of several ultraluminous X-ray sources (ULXs) within IXPE’s field of view. Results. We measured a 2–8 keV polarization degree of 12.4% ± 3.6% and an electric vector polarization angle of 101° ± 8° at a 68% confidence level. If we exclude the spectral region containing bright Fe K lines and other soft X-ray lines where depolarization occurs, the polarization fraction rises to 21.3% ± 6.7% in the 3.5–6.0 keV band, with a similar polarization angle. The observed polarization angle is found to be perpendicular to the parsec-scale radio jet. Using a combined Chandra and IXPE analysis plus multiwavelength constraints, we estimated that the circumnuclear “torus” may sustain a half-opening angle of 50–55° (from the vertical axis of the system). Conclusions. Thanks to IXPE, we have measured the X-ray polarization of NGC 1068 and found comparable results, both in terms of the polarization angle orientation with respect to the radio jet and the torus half-opening angle, to the X-ray polarimetric measurement achieved for the other archetypal Compton-thick AGN: the Circinus galaxy. Probing the geometric arrangement of parsec-scale matter in extragalactic objects is now feasible thanks to X-ray polarimetry.