Attention helps manage the information held in visual working memory (vWM). Perceptual attention selects the stimuli to be represented in vWM, whereas internal attention prioritizes information already in vWM. In the present study we assessed the spatial precision of perceptual and internal attention in vWM. Participants encoded eight colored dots for a local-recognition test. To manipulate attention, a cue indicated the item most likely to be tested (~65% validity). The cue appeared either before the onset of the memory array (precue) or during the retention interval (retrocue). The precue guides perceptual attention to gate encoding into vWM, whereas the retrocue guides internal attention to prioritize the cued item within vWM. If attentional selection is spatially imprecise, attention should be preferentially allocated to the cued location, with a gradual drop-off of attention over space to nearby uncued locations. In this case, memory for uncued locations should vary as a function of their distance from the cued location. As compared to a no-cue condition, memory was better for validly cued items but worse for uncued items. The spatial distance between the uncued and cued locations modulated the cuing costs: Items close in space to the cued location were insulated from cuing costs. The extension of this spatial proximity effect was larger for precues than for retrocues, mostly because the benefits of attention were larger for precues. These results point to similar selection principles between perceptual and internal attention and to a critical role of spatial distance in the selection of visual representations.