# How to clear all variables? [closed]

I have noticed that the old trick of using:

ClearAll["Global*"]


does not appear to work anymore. It does not clear the values of any of my variables. I assume this has to do with some sort of change in Mathematica.

Does anyone have a replacement for this?

NOTE: I also tried using the following without success:

ClearAll @@ {\$Context<>"*"}

• What does Context[variable] return for one of the variables that isn't cleared? – Carl Woll Nov 6 at 19:47
• Possible duplicate of How do I clear all user defined symbols? – kickert Nov 6 at 20:18
• ClearAll["Global*"] should be working for you. Seems to be a local issue instead of a universal one. – kickert Nov 6 at 20:20
• @Carl Woll - Context[variablename] just returns itself, i.e. the output is Context[variablename] – Colin Marcus Nov 7 at 20:07

• E.g. using Quit[] This has the added advantage of restoring any system definitions that you might have accidentally over-written. – mikado Nov 6 at 20:00