1.
why, for what reason
Used to ask the reason or cause for something.
何でだろう。
I wonder why.
何で来なかったの?
Why didn't you come?
何で遅れたの?
Why were you late?
何で泣いてるの?
Why are you crying?
何でそんなことを言うの?
Why would you say something like that?
2.
how, by what means
Used to ask about the means or method.
何で書く?
What do you write with?
Asking about means/tools
何で食べる? — 箸で食べる。
What do you eat it with? — With chopsticks.
何で行く? — 電車で行く。
How are you getting there? — I'm going by train.
何で作ったの? — 紙で作った。
What did you make it with? — I made it with paper.
学校まで何で行っている? — バスで行っている。
How do you get to school? — I go by bus.
USAGE: なんで is a casual way to ask "why" or "how." It's more informal than どうして or なぜ.
FORMALITY LEVELS:
- なんで (casual - most common in spoken Japanese)
- どうして (neutral)
- なぜ (formal/written)
COMMON EXPRESSIONS:
- なんでだろう (I wonder why)
- なんでもない (it's nothing)
- なんでも (anything, whatever)
NOTE: なんで can also mean "by what means" (何で = with what), though context usually makes the meaning clear.