An image graphic featuring a photograph of Robin Williams and a quote ostensibly uttered by him is frequently shared on social media:
The quote reads: "I used to think that the worst thing in life was to end up alone. It’s not. The worst thing in life is to end up with people who make you feel all alone.”
While Williams has a connection to this quote, he is not its original author. This quote comes from the 2009 film "World's Greatest Dad" that was written and directed by Bobcat Goldthwait.
Williams, who plays the character "Lance," a high school teacher who is dealing with the death of his son, speaks a slightly modified version of the above-displayed phrase near the end of the movie.
In the movie, Lance says:
“I used to think the worst thing in life was to end up all alone. It’s not. The worst thing in life is ending up with people who make you feel all alone.”
This quote can be heard around the 1:40-second mark of the following clip:
In other words, Williams made the statement but only while in character in a movie. And just as you wouldn't attribute quotes such as "Luke I am your father" to James Earl Jones, or "Life is like a box of chocolates" to Tom Hanks, this quote shouldn't be attributed directly to Williams himself.