When a person swears an oath or makes a vow in his heart (without uttering it), should he offer expiation?
All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
Having the intention to do an act of obedience does not necessitate offering expiation (when one fails to do it). However, when one intends to do a righteous deed, he should do it. As for the person who confirmedly swears by pronouncing the formula of oath that entails paying expiation, and then breaks it, it is incumbent on him to expiate for his broken oath, and there is no disagreement among scholars in this regard.
The same applies to the person who pronounces the formula of a vow, such as saying, "I make a vow to Allaah The Exalted that I would fast a day, for example, give money in charity, remember Allaah The Almighty or the like," this is a valid binding vow that should be fulfilled. ‘Aa'ishah reported that the Prophet, sallallaahu ‘alayhi wa sallam, said: "Whoever vowed to obey Allaah must obey Him; and whoever vowed to disobey Allaah The Exalted should not disobey Him." [Al-Bukhari]
Allaah Knows best.
You can search for fatwa through many choices