HoldForm[expr]
prints as the expression expr, with expr maintained in an unevaluated form.
HoldForm
HoldForm[expr]
prints as the expression expr, with expr maintained in an unevaluated form.
Details
- HoldForm allows you to see the output form of an expression without performing normal evaluation of the expression.
- HoldForm has attribute HoldAll and performs no operation on its arguments.
- HoldForm is removed by ReleaseHold. »
- HoldForm is generated by default by Trace and related functions and can be inserted as a wrapper by such functions as ToExpression and Extract. »
- Even though expr itself is not evaluated, HoldForm[expr] may still evaluate if expr is of the form f[args] and upvalues for f have been defined. »
Examples
open all close allBasic Examples (3)
HoldForm[1 + 1]HoldForm[x = 3]HoldForm[34 ^ 78]Evaluate the expression by applying ReleaseHold:
ReleaseHold[%]Scope (2)
Applications (1)
Properties & Relations (8)
HoldForm displays without a wrapper:
HoldForm[1 + 1]See the FullForm expression:
FullForm[%]Hold displays the held expression with a wrapper:
Hold[1 + 1]Use Evaluate to force evaluation of an argument of HoldForm:
HoldForm[Evaluate[1 + 1]]Sequence splicing and Splice still happen inside HoldForm:
HoldForm[Sequence[1 + 1]]HoldForm[Splice[{1 + 1}, _]]Use HoldCompleteForm to suppress even such transformations:
HoldCompleteForm[Sequence[1 + 1]]HoldCompleteForm[Splice[{1 + 1}, _]]Upvalues work inside HoldForm:
HoldForm[h[x_]] ^:= HoldForm[f[x]]HoldForm[h[1 + 2]]They do not work inside HoldCompleteForm:
HoldCompleteForm[h[x_]] ^:= HoldCompleteForm[f[x]]HoldCompleteForm[h[1 + 2]]ReleaseHold removes one level of HoldForm:
ReleaseHold[HoldForm[1 + 2]]HoldForm gives an object that is never evaluated:
HoldForm[1 + 2]Copy the output and paste it into an input cell. The 1+2 is still unevaluated:
1 + 2Defer gives an object whose evaluation is merely deferred until it is explicitly given as Wolfram Language input:
Defer[1 + 2]Copy the output and paste it into an input cell. The 1+2 is evaluated:
1 + 2HoldForm maintains expressions in unevaluated form, and all parts are inactive:
HoldForm[Sin[ArcTan[1]]]Inactivate maintains symbols in inactive form and allows parts of expressions to be inactive:
Inactive[Sin][ArcTan[1]]HoldForm can be used to freeze the result of ToExpression before it is evaluated:
ToExpression["1+1", InputForm, HoldForm]Possible Issues (1)
HoldPattern[expr] is equivalent to expr for pattern matching but maintains expr in an unevaluated form:
f[HoldPattern[x_ + y_]] := Hold[x, y]f[Unevaluated[1 + 2]]HoldForm[expr] is not equivalent to expr for pattern matching:
g[HoldForm[x_ + y_]] := Hold[x, y]g[Unevaluated[1 + 2]]Only a literal HoldForm expression is matched:
g[HoldForm[1 + 2]]Tech Notes
Related Guides
Related Workflows
History
Introduced in 1988 (1.0)
Text
Wolfram Research (1988), HoldForm, Wolfram Language function, https://reference.wolfram.com/language/ref/HoldForm.html.
CMS
Wolfram Language. 1988. "HoldForm." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/HoldForm.html.
APA
Wolfram Language. (1988). HoldForm. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/HoldForm.html
BibTeX
@misc{reference.wolfram_2026_holdform, author="Wolfram Research", title="{HoldForm}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/HoldForm.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_holdform, organization={Wolfram Research}, title={HoldForm}, year={1988}, url={https://reference.wolfram.com/language/ref/HoldForm.html}, note=[Accessed: 12-June-2026]}