clears all values, definitions, attributes, messages, and defaults associated with symbols.


clears all symbols whose names textually match any of the formi.


open allclose all

Basic Examples  (1)

Define values and attributes for a symbol:

Clear values and attributes:

Scope  (4)

Clear values of variables:

Clear functions (downvalues):

Clear upvalues:

Clear several symbols:

Generalizations & Extensions  (2)

Clear all symbols in a given context:

Specify symbols to clear as string patterns:

Applications  (2)

Clear any old definitions before making new ones:

Unprotect and clear all symbols in a package, to allow it to be read twice:

Properties & Relations  (2)

Clear does not remove defaults, options, or attributes:

Use ClearAll to clear everything:

Use =. to clear definitions with a particular left-hand side:

Clear all definitions:

Possible Issues  (1)

Protected symbols cannot be cleared:

Use Unprotect to clear definitions of protected symbols:

Neat Examples  (1)

Clear the definitions of all symbols in the current context:

Wolfram Research (1988), ClearAll, Wolfram Language function,


Wolfram Research (1988), ClearAll, Wolfram Language function,


@misc{reference.wolfram_2020_clearall, author="Wolfram Research", title="{ClearAll}", year="1988", howpublished="\url{}", note=[Accessed: 21-April-2021 ]}


@online{reference.wolfram_2020_clearall, organization={Wolfram Research}, title={ClearAll}, year={1988}, url={}, note=[Accessed: 21-April-2021 ]}


Wolfram Language. 1988. "ClearAll." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (1988). ClearAll. Wolfram Language & System Documentation Center. Retrieved from