Quick answer
-то = something specific that you cannot name. -нибудь = anything at all, not yet chosen.
The pairs
| -то (specific) | -нибудь (any) | Meaning |
|---|---|---|
| кто́-то | кто́-нибудь | someone / anyone |
| что́-то | что́-нибудь | something / anything |
| где́-то | где́-нибудь | somewhere / anywhere |
| куда́-то | куда́-нибудь | to somewhere / to anywhere |
| когда́-то | когда́-нибудь | once / ever |
| како́й-то | како́й-нибудь | some / any kind of |
Both halves are written with a hyphen, and the stress stays on the question word: кто́-то, что́-нибудь.
How to choose
Rule of thumb: in statements about the past, -то. In requests, questions and the future, -нибудь. Ты что́-нибудь ви́дел? — did you see anything? Я что́-то ви́дел — I saw something.
The third option: кое-
Кое-что́ and кое-кто́ mean “a certain something / someone” that the speaker *does* know but is not naming: Я кое-что́ зна́ю — I know a thing or two. It carries a hint of deliberate vagueness.
когда́-то vs когда́-нибудь
Когда́-то я жил в Москве́ — once, long ago. Я когда́-нибудь пое́ду в Москву́ — someday I will go. One looks back, the other forward: the same logic as the whole pair.
Typical mistakes
Купи́ что́-то.
Купи́ что́-нибудь.
A request leaves the choice open.
Кто́-нибудь звони́л вчера́.
Кто́-то звони́л вчера́.
It definitely happened, so -то.
Check yourself
Купи́ ___ на у́жин. — Buy something for dinner.