Kex is the Swedish term for biscuit (or cookie, for our American readers). Foods that fall into the kex category are generally hard (as opposed to soft cake, which is called kaka or tårta), thin, and flat, and can be sweet or savoury, in contrast to the English definition by which they're almost always sweet.
The noun actually derives from the English term 'cakes', which itself was borrowed from Old Norse kaka. But Swedish differentiates between kaka and kex: kaka refers to baked goods which would be called biscuits in English (like pepparkaka or gingerbread) as well as ones which correspond to English cake (like morotskaka or carrot cake), while kex refers to a sub-category of biscuits. This includes the small cookies that often come served with tea or coffee at fika time, but also savoury snacks eaten in the same context as bread or crackers, topped with savoury pastes, eaten with cheese or even served with soup.
If you want to refer specifically to sweet biscuits, say småkaka (literally 'little cake'). One of the most popular brands is Mariekex, and there's also a chocolate bar simply named Kex, which has a nougat wafer filling.
The oldest known use of kex in Sweden was in an 18th-century cookbook, and like many loan words, spelling was unstable at first, so in older written records it's spelled cakes, caksen, kakes, and later käx, kjex, and kiks.
Tea and kex, anyone? via GIPHY
A common linguistic debate between Swedes from the south and north of the country is whether the word should be pronounced with a 'k' sound (as in the root word 'cakes') or with a 'sh' sound. Southerners and Gothenburgers tend to say shex, while northern Swedes and Stockholmers go for kex.
Swedish linguists tend to favour the former pronunciation as the most correct, due to analogy with other words such as kedja (chain), but at The Local we're in favour of linguistic variation and the Swedish Language Council says both forms are valid, so pronounce it whichever way you choose, as long as you get your biscuit. But if you find yourself in a group of Swedes from across the country, starting a kex/shex debate is a good way to fill any awkward silences.
Kex can also be used as an affectionate term for a woman, as in the classic pick-up line tjena kexet, står du här och smular? (hey cookie, are you standing there crumbling?). And in slang, it can refer to 1,000 kronor, so if someone tells you they earned tjugo kex (literally 'twenty biscuits') last week at work, there's no need to worry that they're being exploited.
Vi bjuder på kaffe och kex
We're serving coffee and biscuits
Det står ett paket kex i skåpet
There's a pack of biscuits in the cupboard