Converting between Expressions & Strings

Expressions in Mathematica can be represented as strings in a variety of ways, for display, export, or processing. Mathematica provides powerful functions for formatting expressions as strings, and for parsing strings to determine the expressions they represent.

ReferenceReference

ToString convert any expression to a string

ToExpression convert a string to an expression

Format Types »

InputForm ▪ OutputForm ▪ StandardForm ▪ TraditionalForm ▪ TeXForm ▪ ...

SyntaxQ, SyntaxLength test syntactic correctness of input strings

ImportString import many formats of strings to give expressions

ExportString export expressions to give many formats of strings

StringFormat ▪ Hash

Special Conversions

IntegerString convert an integer to a string

DateList, DateString convert between string and list forms of dates

Symbol, SymbolName convert between strings and symbols

SpokenString convert to a spoken representation of an expression

New to Mathematica? Find your learning path »
Have a question? Ask support »