InputForm[expr]
prints as a version of expr suitable for input to the Wolfram Language.
InputForm
InputForm[expr]
prints as a version of expr suitable for input to the Wolfram Language.
Details and Options
- InputForm always produces one-dimensional output, suitable to be typed as lines of Wolfram Language input.
- The typeset form of InputForm[expr] is interpreted the same as expr when used in input. »
- When an input evaluates to InputForm[expr], InputForm does not appear in the output. »
- Put (>>) produces InputForm by default.
- Short[InputForm[expr]] can be used, but may generate skeleton objects that cannot be given as Wolfram Language input.
- The option NumberMarks can be used to specify whether ` marks should be used to indicate type, precision, or accuracy of approximate numbers. »
Examples
open all close allBasic Examples (2)
Scope (8)
Basic Objects (2)
Integer, Rational, Real, and Complex numbers:
Map[InputForm, {123, 1 / 23, 1.23, 1 + 23I}]Arbitrary‐precision Real and Complex numbers:
InputForm /@ N[{10 / 3, 10 / 3I}, 20]InputForm /@ {I, π, E}Characters and strings of characters:
InputForm /@ {"a", "α", "⊕"}Control characters for strings:
InputForm["A first line
A second line"]Special Input Forms (4)
Different ways of representing Power expressions:
InputForm /@ {a ^ x, a^x, a^(1/(3)), Exp[x], 1 / x, (1/x)}InputForm /@ {y'[x], ∫y[x]ⅆx, Subsuperscript[∑, k = 1, n]y[k], Subsuperscript[∏, k = 1, n]y[k], x∈Reals, x∧y∨z}InputForm[{1, 2, 3}]InputForm /@ {(| | | |
| - | - | - |
| a | b | c |
| d | e | f |), {{a, b, c}, {d, e, f}}}Input without special interpretation:
InputForm /@ {Subscript[x, a], Overscript[x, a], Underscript[x, a]}With special characters in the same positions, there may be special interpretations:
InputForm /@ {Subscript[x, - ], Overscript[x, _], Underscript[x, _]}In the case of superscripts, most things get interpreted as Power:
InputForm /@ {x^a, Subsuperscript[x, b, a], x^†}Special Output Forms (2)
Some objects use a special output representation:
Series[Sin[x], {x, 0, 3}]InputForm[%]Some objects use an elided output representation:
i = Interpolation[{1, 2, 3, 1}]s = SparseArray[{{1, 2} -> 1}, {5, 5}]The elided parts are visible using InputForm:
InputForm[i]InputForm[s]Options (3)
NumberMarks (3)
Machine numbers format without number marks by default:
InputForm[N[1 / 3]]The same number with number marks:
InputForm[N[1 / 3], NumberMarks -> True]Extended-precision numbers include number marks by default:
InputForm[N[10 / 3, 20]]InputForm[N[10 / 3, 20], NumberMarks -> False]A mixed symbolic and numeric expression:
expr = N[10, 4]Sin[.25x]InputForm[expr]Include number marks for all numbers:
InputForm[expr, NumberMarks -> True]InputForm[expr, NumberMarks -> False]Properties & Relations (4)
The typeset form of InputForm[expr] is interpreted the same as expr when used in input:
{InputForm[x ^ 2]}Copy the output and paste it into an input cell. The x^2 is interpreted as x2:
{InputForm[x^2]}When an input evaluates to InputForm[expr], InputForm does not appear in the output:
InputForm[x ^ 2]Out is assigned the value x2, not InputForm[x^2]:
%InputForm has a linear formatting:
InputForm[Exp[I x / n]]FullForm has linear formatting without special syntax:
FullForm[Exp[I x / n]]OutputForm, StandardForm, and TraditionalForm all provide two-dimensional formatting:
OutputForm[Exp[I x / n]]StandardForm[Exp[I x / n]]TraditionalForm[Exp[I x / n]]Use ToString to generate a string in input form:
ToString[(1/a) + x^2, InputForm]Head[%]Possible Issues (1)
Even when an output omits InputForm from the top level, it is not stripped from subexpressions:
e = InputForm[x ^ 2]The output does not have InputForm in it:
%However, the variable e does have InputForm in it, which may affect subsequent evaluations:
FullForm[e]The product is not evaluated due to the intervening InputForm:
x * eAssign variables first and then apply InputForm to the result to maintain computability:
(f = x ^ 2)//InputFormx * fSee Also
OutputForm FullForm StandardForm TextString Compress BinarySerialize
Function Repository: ReadableForm
Related Links
-

An Elementary Introduction to the Wolfram Language
: Strings and Text
-

An Elementary Introduction to the Wolfram Language
: Real-World Data
-

An Elementary Introduction to the Wolfram Language
: Units
-

An Elementary Introduction to the Wolfram Language
: Dates and Times
-

NKS|Online
(A New Kind of Science)
History
Introduced in 1988 (1.0) | Updated in 1996 (3.0)
Text
Wolfram Research (1988), InputForm, Wolfram Language function, https://reference.wolfram.com/language/ref/InputForm.html (updated 1996).
CMS
Wolfram Language. 1988. "InputForm." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 1996. https://reference.wolfram.com/language/ref/InputForm.html.
APA
Wolfram Language. (1988). InputForm. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/InputForm.html
BibTeX
@misc{reference.wolfram_2026_inputform, author="Wolfram Research", title="{InputForm}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/InputForm.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_inputform, organization={Wolfram Research}, title={InputForm}, year={1996}, url={https://reference.wolfram.com/language/ref/InputForm.html}, note=[Accessed: 13-June-2026]}