The Stack Overflow podcast is back! Listen to an interview with our new CEO.
1 of 2

For polynomial expressions @Buddha_the_Scientist's suggestion Variables will work. For more general expressions

expr = x^2 + y^3 + z
DeleteDuplicates@Cases[expr, _Symbol, \[Infinity]]

Should do the trick in most situations.