# What is the difference between ~\ and \ [duplicate]

While I was writing one of my first papers in LaTeX, I used the reference/citing style that was used in the example provided by the professor. For referencing or citing, he uses ~\ref{} or ~\cite{}, but I noticed that in my document \ref{} and \cite{} gave the same result. Can anyone explain me difference and notation and when to use which if there is a difference?
• Using ~ will result in a non-breakable whitespace, which means that TeX cannot do a line break there. This is usually what you want with \cite or \ref, when e.g. having something like look at Figure~\cite{fig:x} in your document where you don't want to be the word “Figure” on a different line than the number of the figure. – Stephan Lukasczyk Jan 23 '17 at 13:01