This experiment investigated the preference of juvenile pigs for illuminance, and indirectly photoperiod, at two ages. The animals were equally familiar with all illuminances prior to testing. Four groups, each of four pigs, occupied a four-compartment preference chamber in which a different illuminance was applied to each compartment: minimum (2.4), 4, 40 and 400lx. Illuminances were rearranged every 2 days to avoid positional bias. The pigs significantly preferred the dimmest illuminance (mean occupancy 7h 20min per 24h, backtransformed data) and spent the least time in the brightest (4h 49min per 24h), with an intermediate and similar length of time spent in the other illuminances (6h 25min and 5h 25min in 4 and 40lx, respectively, F 3,127 =8.93, P<0.001). The most common behaviours of the pigs when in the darkest compartment were resting and sleeping. The EU directive 2001/88 requires a minimum illuminance of 40lx for pig production; this illuminance was neither aversive nor strongly preferred by the pigs. Our findings also suggest that pigs should be provided with an appropriate period of rest at an illuminance of 2.4lx for at least 6h per day. The only active behaviour affected by illuminance was defecation; the pigs preferred to defecate in the brighter illuminances. Spatial provision of minimal illuminance could potentially improve pig welfare by providing a preferred light environment for resting and also by creating a resting area distinct from dunging areas, thus improving hygiene.