If you've got a big test coming up, it might be a bad idea to study all night, as scientists have found a good night's sleep improves your memory.
A team found that people could remember the things a list of words had in common better after a snooze than after spending the same time awake.
The head of the research says sleep helps us to understand information as well as just remembering facts.
"Sleep helps us extract rules from our experiences," said Bob Stickgold.
In one of his tests, people were shown cards with symbols on them, followed by weather reports.
For example, diamond shapes would come before rain most of the time.
Twelve hours after training, people were asked to guess the weather from the symbols. After sleeping, their predictions were 10% better.