You are actually shorter by the time you go to bed, thanks to natural height fluctuation.
Throughout the day, the fluid in your spinal discs gets squeezed out by gravity, impacting your total human height. While you sleep, your spine rehydrates and recovers, making spinal disc compression a normal, temporary cycle.
Subscribe for more explainers on why your body does the weird things it does.
source

If you want to actually check this on yourself: measure your height first thing in the morning
before you've been on your feet, then again last thing at night. Same wall, same shoes off, same
posture. Most people find somewhere between one and two centimetres.
The reason it works is that your intervertebral discs are mostly water and they behave like very
stiff sponges. A day of standing, sitting and walking presses fluid out of them. A night lying
down lets it soak back in. Each disc only loses a fraction of a millimetre — but you've got a
whole column of them, and it adds up.
Two things people ask:
Astronauts get the extreme version of this. Without gravity loading the spine, the discs stay
fully expanded and people genuinely gain a few centimetres in orbit. It reverses when they come
back.
And no, this isn't the same thing as the height people lose as they get older. That's a slower,
permanent change involving disc degeneration and bone density, not the daily squeeze-and-refill.
The daily one you get back every single night.