To let one's gaze or thoughts wander or move around without a fixed goal.
example
Während der langweiligen Präsentation ließ er seinen Blick aus dem Fenster schweifen.
During the boring presentation, he let his gaze wander out the window.
Usage tips
Context clues
You can recognize the meaning of 'schweifen' (to wander/digress/roam) from the object: If it refers to 'Blick' (gaze) or 'Gedanken' (thoughts), it is about wandering around. If it refers to 'Thema' (topic), it is about digressing. If it refers to people or animals, it is about roaming around.
EXAMPLE
Sein Blick schwiff unruhig durch den Raum.
His gaze wandered restlessly around the room.
Fixed construction
In this meaning, 'schweifen' (to wander) is very often used in the fixed construction with the verb 'lassen' (to let): 'den Blick schweifen lassen' (to let one's gaze wander) or 'die Gedanken schweifen lassen' (to let one's thoughts wander).
EXAMPLE
Am Strand ließ sie ihre Gedanken in die Ferne schweifen.
On the beach, she let her thoughts wander into the distance.
Use with 'ab-'
When it is about getting away from a topic, the separable verb 'abschweifen' (to digress) is almost always used today. It is more common and clearer than the simple 'schweifen' (to digress).
EXAMPLE
Entschuldigung, ich bin vom Thema abgeschweift.
Sorry, I digressed from the topic.
Register: archaic
The meaning 'umherziehen' (to roam around) is archaic and today is used almost only in literary or historical texts.
EXAMPLE
In alten Gedichten liest man von Rittern, die durch die Wälder schweiften.
In old poems, you read about knights who roamed through the forests.
Auxiliary verb 'sein'
When 'schweifen' (to roam) describes movement from one place to another, the perfect tense is formed with the auxiliary verb 'sein' (to be).
EXAMPLE
Die Wölfe sind nächtelang durch das Revier geschwiffen.
The wolves roamed through the territory for nights on end.
Compare with
near_synonym · confusable
schweifen vs wandern
to hike / migrate / wander
'wandern' and 'schweifen' can both describe movement without a very fixed point. 'wandern' is normally used for people who walk longer distances in nature. It can also mean figuratively that something slowly changes location. 'schweifen' is used today mainly for one's gaze or thoughts: they move without a clear goal. As physical movement, 'schweifen' sounds rather literary or old-fashioned. The words can be confusing because you can also say that thoughts 'wandern' (wander). But the more natural pattern is: people 'wandern' in the forest; thoughts or gazes 'schweifen ab' or 'schweifen umher' (wander off or wander around).
schweifen
Während des langen Vortrags schweifen seine Gedanken immer wieder ab.
During the long lecture, his thoughts keep wandering off.
wandern
Am Sonntag wandern wir drei Stunden durch den Wald.
On Sunday, we are hiking through the forest for three hours.