Questions & Answers about Если мне хочется чего-нибудь сладкого, я покупаю сырок.
Хочется comes from хотеться, an impersonal verb meaning something like to feel like or to have a desire for.
So:
- я хочу = I want
- мне хочется = I feel like / I have a craving for
The structure is different from English:
- мне is in the dative case
- хочется stays in 3rd person singular neuter form
Literally, it is closer to to me it is wanted or it feels desirable to me, though that literal translation is not natural English.
In this sentence, мне хочется sounds a bit softer and more about a craving or mood than я хочу.
Compare:
- Я хочу кофе. = I want coffee.
- Мне хочется кофе. = I feel like having coffee.
Because хотеться uses the dative for the person who experiences the feeling.
This is common with impersonal expressions in Russian. The person is not the grammatical subject in the usual nominative form.
So:
- мне хочется = I feel like
- тебе хочется = you feel like
- ему хочется = he feels like
This is similar to other Russian patterns such as:
- мне нравится = I like
- мне холодно = I am cold
- мне нужно = I need
In all of these, the experiencer is in the dative.