

SyntaxQ
Details

- If SyntaxQ returns False, you can find the position of a syntax error using SyntaxLength.
- form can be InputForm, StandardForm, TeXForm, TraditionalForm, or MathMLForm.
Examples
open all close allBasic Examples (2)
Scope (2)
Verify a TeXForm input:
This can be converted to a Wolfram Language expression:
SyntaxQ can verify strings containing StandardForm or TraditionalForm boxes:
It does not accept the boxes themselves:

Properties & Relations (2)
The default interpretation form is InputForm:
This input is valid MathMLForm:
Use SyntaxLength to find the longest leading substring which is syntactically valid:
See Also
ToExpression SyntaxLength $SyntaxHandler WolframLanguageData DelimiterFlashTime
Function Repository: ValidSymbolIdentifierQ
Tech Notes
Related Guides
History
Introduced in 1991 (2.0) | Updated in 2017 (11.1)
Text
Wolfram Research (1991), SyntaxQ, Wolfram Language function, https://reference.wolfram.com/language/ref/SyntaxQ.html (updated 2017).
CMS
Wolfram Language. 1991. "SyntaxQ." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/SyntaxQ.html.
APA
Wolfram Language. (1991). SyntaxQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SyntaxQ.html
BibTeX
@misc{reference.wolfram_2025_syntaxq, author="Wolfram Research", title="{SyntaxQ}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/SyntaxQ.html}", note=[Accessed: 08-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_syntaxq, organization={Wolfram Research}, title={SyntaxQ}, year={2017}, url={https://reference.wolfram.com/language/ref/SyntaxQ.html}, note=[Accessed: 08-August-2025]}