({{, (RefLink[InputForm, paclet:ref/InputForm])[expr]
prints as a version of expr suitable for input to the Wolfram Language. }})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[InputForm, paclet:ref/InputForm]) always produces one-dimensional output, suitable to be typed as lines of Wolfram Language input.

(RefLink[InputForm, paclet:ref/InputForm]) acts as a "wrapper", which affects display, but not evaluation. »

(RefLink[Put, paclet:ref/Put]) (>>) produces (RefLink[InputForm, paclet:ref/InputForm]) by default.

(RefLink[Short, paclet:ref/Short])[InputForm[expr]] can be used, but may generate skeleton objects that cannot be given as Wolfram Language input.

The option (RefLink[NumberMarks, paclet:ref/NumberMarks]) can be used to specify whether ` marks should be used to indicate type, precision, or accuracy of approximate numbers. »

OpenersPrimaryExamplesSection(Spacer1)Examples  (16)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

(RefLink[InputForm, paclet:ref/InputForm]) of a typeset expression:

InputForm[(x/(Sqrt[5]))+(y^2)+1/z]

(RefLink[InputForm, paclet:ref/InputForm]) of a graphic:

//InputForm

OpenersExampleSection1(Spacer1)Scope  (8)

OpenersExampleSubsection0(Spacer1)Basic Objects  (2)

(RefLink[Integer, paclet:ref/Integer]), (RefLink[Rational, paclet:ref/Rational]), (RefLink[Real, paclet:ref/Real]), and (RefLink[Complex, paclet:ref/Complex]) numbers:

Map[InputForm,{123,1/23,1.23,1+23I}]

Arbitrary-precision (RefLink[Real, paclet:ref/Real]) and (RefLink[Complex, paclet:ref/Complex]) numbers:

InputForm/@N[{10/3,10/3I},20]

Special constants:

InputForm/@{I,π,E}

Characters and strings of characters:

InputForm/@{"a","α","⊕"}

Control characters for strings:

InputForm["A first line
A second line"]

OpenersExampleSubsection1(Spacer1)Special Input Forms  (4)

Different ways of representing (RefLink[Power, paclet:ref/Power]) expressions:

InputForm/@{a^x,(a^x),(a^(1/3)),Exp[x],1/x,(1/x)}

Special typeset expressions:

InputForm/@{y'[x],∫y[x]\[DifferentialD]x,(∑_(k=1)^n)y[k],(∏_(k=1)^n)y[k],x∈Reals,x∧y∨z}

Different list structures:

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/@{(SubMinus[x]),(OverBar[x]),(UnderBar[x])}

In the case of superscripts, most things get interpreted as (RefLink[Power, paclet:ref/Power]):

InputForm/@{(x^a),(Subscript[x, b]^a),(SuperDagger[x])}

OpenersExampleSubsection2(Spacer1)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 (RefLink[InputForm, paclet:ref/InputForm]):

InputForm[i]

InputForm[s]

OpenersExampleSection2(Spacer1)Options  (3)

OpenersExampleSubsection3(Spacer1)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]]

Without number marks:

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]

Omit all number marks:

InputForm[expr,NumberMarks->False]

OpenersExampleSection3(Spacer1)Properties & Relations  (3)

(RefLink[InputForm, paclet:ref/InputForm]) affects display but not evaluation:

InputForm[Integrate[x^n,x]]

Apply (RefLink[InputForm, paclet:ref/InputForm]) to the evaluated integral:

Integrate[x^n,x]

InputForm[%]

(RefLink[InputForm, paclet:ref/InputForm]) has a linear formatting:

InputForm[Exp[I x/n]]

(RefLink[FullForm, paclet:ref/FullForm]) has linear formatting without special syntax:

FullForm[Exp[I x/n]]

(RefLink[OutputForm, paclet:ref/OutputForm]), (RefLink[StandardForm, paclet:ref/StandardForm]), and (RefLink[TraditionalForm, paclet:ref/TraditionalForm]) all provide two-dimensional formatting:

OutputForm[Exp[I x/n]]

StandardForm[Exp[I x/n]]

TraditionalForm[Exp[I x/n]]

Use (RefLink[ToString, paclet:ref/ToString]) to generate a string in input form:

ToString[(1/a)+(x^2),InputForm]

Head[%]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[OutputForm, paclet:ref/OutputForm])  ▪  (RefLink[FullForm, paclet:ref/FullForm])  ▪  (RefLink[StandardForm, paclet:ref/StandardForm])  ▪  (RefLink[TextString, paclet:ref/TextString])  ▪  (RefLink[Compress, paclet:ref/Compress])  ▪  (RefLink[BinarySerialize, paclet:ref/BinarySerialize])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Redrawing and Combining Plots, paclet:tutorial/RedrawingAndCombiningPlots])}, {▪(RefLinkPlain[Forms of Input and Output, paclet:tutorial/FormsOfInputAndOutput])}, {▪(RefLinkPlain[The Interpretation of Textual Forms, paclet:tutorial/TheInterpretationOfTextualForms])}, {▪(RefLinkPlain[The Representation of Textual Forms, paclet:tutorial/TheRepresentationOfTextualForms])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Mathematical Typesetting, paclet:guide/MathematicalTypesetting])}, {▪(RefLinkPlain[Display of Numbers, paclet:guide/DisplayOfNumbers])}, {▪(RefLinkPlain[Wolfram System Session History, paclet:guide/WolframSystemSessionHistory])}, {▪(RefLinkPlain[Wolfram Client Library for Python, paclet:guide/WolframClientLibraryForPython])}, {▪(RefLinkPlain[Converting between Expressions & Strings, paclet:guide/ConvertingBetweenExpressionsAndStrings])}, {▪(RefLinkPlain[Numerical Evaluation & Precision, paclet:guide/NumericalEvaluationAndPrecision])}})}})

({{(Spacer1), ({{(Spacer1)Related Links}, {(WebLink[DocumentationFooterIconsRelatedLinks-EIWL.png(Spacer1)An Elementary Introduction to the Wolfram Language, https://www.wolfram.com/language/elementary-introduction/11-strings-and-text.html])(WebLink[: Strings and Text, https://www.wolfram.com/language/elementary-introduction/11-strings-and-text.html])}, {(WebLink[DocumentationFooterIconsRelatedLinks-EIWL.png(Spacer1)An Elementary Introduction to the Wolfram Language, https://www.wolfram.com/language/elementary-introduction/16-real-world-data.html])(WebLink[: Real-World Data, https://www.wolfram.com/language/elementary-introduction/16-real-world-data.html])}, {(WebLink[DocumentationFooterIconsRelatedLinks-EIWL.png(Spacer1)An Elementary Introduction to the Wolfram Language, https://www.wolfram.com/language/elementary-introduction/17-units.html])(WebLink[: Units, https://www.wolfram.com/language/elementary-introduction/17-units.html])}, {(WebLink[DocumentationFooterIconsRelatedLinks-EIWL.png(Spacer1)An Elementary Introduction to the Wolfram Language, https://www.wolfram.com/language/elementary-introduction/19-dates-and-times.html])(WebLink[: Dates and Times, https://www.wolfram.com/language/elementary-introduction/19-dates-and-times.html])}, {(WebLink[DocumentationFooterIconsRelatedLinks-NKS.png(Spacer1)NKS|Online, http://www.wolframscience.com/nksonline/index/search.cgi?SearchIndex=InputForm]) ((WebLink[A New Kind of Science, http://www.wolframscience.com/nksonline/]))}})}})