Using toothpaste whilst fasting is not impermissible or haram [prohibited], but makruh [disliked] if used without a valid need to do so.
Imam Ahmad Rida Khan (may Allah have mercy upon him) states: “(Using) toothpowder (whilst fasting) is not impermissible or haram when one is sure that its traces do not reach the throat. Using it without a valid need is makruh. It is stated in al-Durr al-Mukhtar, ‘It is disliked for the one fasting to taste something.’”
[Fatawa Ridawiyyah, Section on Disliked Acts, 10/551]
It is highly possible that using toothpaste causes its traces to reach the throat. Thus it is necessary to abstain from using it. Imam Ahmad Rida Khan (may Allah have mercy upon him) states: “Toothpowder should not be used whilst fasting.”
[Fatawa Ridawiyyah, Book of Fasting, 10/511]
Allah and His Messenger (prayers and peace be upon him) know best.
Answered by Mufti Abu Salih Muhammad Qasim al-Qadiri (may Allah protect him)