In this paper, vacuum flux surface mapping is used to measure the error field in Wendelstein 7-X. Two methods for discriminating the perturbation from other co-resonant modes are applied: measurements of the helical axis shift in a magnetic configuration with the rotational transform barely above one on the axis; and measurements of the edge island structure with cancellation of intrinsic islands by divertor control coils. The normalized radial amplitude in Boozer coordinates is found to be about in the first case and about in the second one, with the discrepancy being attributable to different currents in the planar coils. The error field can be reliably compensated by using error field trim coils with currents about 100 A. This compensation also helps to identify the error field of about . During plasma operation in divertor configurations, it is confirmed that the present field leads to asymmetries in the power distribution and that the compensation improves this symmetry.