Symbol["name"]
refers to a symbol with the specified name.
Symbol
Symbol["name"]
refers to a symbol with the specified name.
Details
- All symbols, whether explicitly entered using Symbol or not, have head Symbol.
- x_Symbol can be used as a pattern to represent any symbol.
- The string "name" in Symbol["name"] must be an appropriate name for a symbol. It can contain any letters, letter‐like forms, or digits, but cannot start with a digit.
- Symbol["name"] creates a new symbol if none exists with the specified name.
- A symbol such as x has a name "x".
- If Symbol["name"] creates a new symbol, it does so in the context specified by $Context.
Examples
open all close allBasic Examples (1)
Scope (4)
Use Symbol to create new symbols in a program:
Symbol["x" <> "1"]Use Symbol for pattern matching:
{f[x], f["x"], f[2]} /. f[s_Symbol] :> g[s]Create a symbol in a given context:
Symbol["a`x"]Context[Evaluate[%]]Create a symbol in the current context:
Symbol["`x"]Applications (1)
Properties & Relations (9)
Symbol creates new symbols in the current context:
Names["`x*"]Symbol["x1"]Names["`x*"]Unique creates symbols with a unique new name:
Unique["x"]Table[Unique["x"], {5}]Module creates new temporary symbols every time it is evaluated:
Module[{x}, x]Symbol and SymbolName are inverses of each other:
Symbol[SymbolName[x17]]SymbolName[Symbol["y32"]]//InputFormMany functions of symbols also accept symbol names as arguments:
Attributes["Pi"]Context gives the context of a symbol:
Context[Integrate]Possible symbol names can be characterized by regular expressions:
StringMatchQ[#, RegularExpression["[[:alpha:]$][[:alnum:]$]*"]]& /@ {"sym1", "1x", "mäder", "x_1", "$1"}Symbol resolves context aliases:
$ContextAliases["abc`"] = "NewContext`";
abc`newSymbol;
Symbol["abc`newSymbol"]LocalSymbol and CloudSymbol provide for persistent storage of values:
LocalSymbol["x"] = 10!;CloudSymbol["x"] = 11!;{LocalSymbol["x"], CloudSymbol["x"]}See Also
SymbolName ToExpression Unique Remove LocalSymbol CloudSymbol WolframLanguageData
Function Repository: SymbolQ ValidSymbolIdentifierQ
Related Guides
History
Introduced in 1988 (1.0) | Updated in 1996 (3.0)
Text
Wolfram Research (1988), Symbol, Wolfram Language function, https://reference.wolfram.com/language/ref/Symbol.html (updated 1996).
CMS
Wolfram Language. 1988. "Symbol." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 1996. https://reference.wolfram.com/language/ref/Symbol.html.
APA
Wolfram Language. (1988). Symbol. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Symbol.html
BibTeX
@misc{reference.wolfram_2026_symbol, author="Wolfram Research", title="{Symbol}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/Symbol.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_symbol, organization={Wolfram Research}, title={Symbol}, year={1996}, url={https://reference.wolfram.com/language/ref/Symbol.html}, note=[Accessed: 12-June-2026]}