The latest time of day you can drink coffee and still have a good night's sleep.

Feeling exhausted? You’re not alone.

One in five Australians describe their sleep as poor, with 16 per cent admitting to getting less than five hours of sleep a night, according to recent research by Koala Mattress released earlier this year to mark World Sleep Day.

While there are a number of factors that contribute to this, that afternoon coffee you’re currently sipping could have something to do with it.

Image: iStock.

"What you put in your body can heavily affect your sleep," explains Dr Andrew Rochford.

Caffeine works by changing the chemistry of the brain, blocking the action of adenosine, a natural brain chemical that is associated with sleep.

"How caffeine affects you is a bit genetic," he says.

"You know, some people can drink espresso after dinner and fall asleep three seconds later!"

However for most of us, a coffee later in the afternoon can have a significant impact on our ability to fall asleep and get a restful night.

"You can potentially get away with a coffee in the afternoon, probably at the latest one to two pm," Dr Rochford says.

However if you have real trouble sleeping, or are highly sensitive to caffeine, it's even earlier.

Listen: Robin Bailey shares her trick to getting more sleep on The Well. Post continues after audio.

"You've got to have your own barometer but general rule is not after lunch," he says.

To help you get better sleep, Koala are encouraging people to make sleep a priority and head to bed an hour earlier.

"If you're not getting enough sleep, I think one more hour will encourage people to focus on getting more sleep. We cram everything into our days and nights and on the days when you then binge Netflix until 2am, that's the moment when one hour sleep is much more needed," says Dr Rochford.

"It's about people starting to recognise that you need to place the same kind of emphasis on sleep as you do other health-related habits such as food or exercise."