Praise be to Allah.
Do you have to say intention for fasting?
The Ramadan fast and other acts of worship are not valid unless accompanied by the proper intention. This is because the Prophet (peace and blessings of Allah be upon him) said: “Actions are but by intentions, and everyone shall have but that which he intended…” (Narrated by al-Bukhari, 1; Muslim, 1907)
When to make intention for fasting
The intention is subject to the condition that it be made at night, before the dawn comes. This is because the Prophet (peace and blessings of Allah be upon him) said: “Whoever does not intend to fast before dawn, there is no fast for him.” (Narrated by al-Tirmidhi, 730)
According to a version narrated by al-Nasai (2334): “Whoever does not intend to fast from the night before, there is no fast for him.” (Classed as hasan by al-Albani in Sahih al-Tirmidhi, 573)
What is meant is that whoever does not intend to fast and resolve to do so from the night before, his fast is not valid.
Is uttering the intention for fasting out loud required?
The intention (niyyah) is an action of the heart. The Muslim should resolve in his heart that he is going to fast tomorrow. It is not prescribed for him to utter it out loud and say, “I intend to fast” or “I will fast tomorrow” or other phrases that have been innovated by some people.
How to formulate the intention to fast
The correct intention is when a person resolves in his heart that he is going to fast tomorrow.
Hence Shaykh al-Islam Ibn Taymiyah said in al-Ikhtiyarat (p. 191):
“If it crosses a person’s mind that he is going to fast tomorrow, then he has made the intention.”
The Standing Committee was asked: How should a person intend to fast Ramadan ?
“The intention is done by resolving to fast. It is essential that the intention to fast Ramadan be made every night.” (Fatawa al-Lajnah al-Daimah, 10/246)
And Allah knows best.