How to Fix a Gaussian Syntax Error on the Input Line
At a glance
- 1. Find the reported line
Read the output around the syntax error and identify the input line Gaussian could not parse.
- 2. Check input sections
Verify the route, title, charge and multiplicity, and geometry are separated by blank lines.
- 3. Check keywords and symbols
Correct misspelled options, malformed keyword arguments, and unusual copied characters.
- 4. Test a minimal input
Run a small, clean input to separate syntax problems from chemistry or convergence problems.
Gaussian’s “syntax error in input line” message means that the program could not interpret part of the input file. It is usually an input-format or keyword problem, not evidence that the molecule or calculation is chemically impossible.
The message alone does not point to one universal fix. Use the output to locate the troublesome line, then check the input’s sections and spelling. A calculation that begins normally but later stops with a convergence or runtime error has a different problem.
Find the line Gaussian could not parse
Look in the output file for a message like QPErr --- A syntax error was detected in the input line. Gaussian often echoes the offending line and marks a position near the problem. That position is a clue, not always an exact pointer: an unclosed option or an error earlier on the same route line can make the parser complain later in the line.
Compare the reported line with the original input file, not a reformatted copy. If your job was submitted through a graphical interface or workflow tool, check the actual input file it generated. The program may have added or altered keywords, line breaks, or characters.
Check the input sections and blank lines
A typical Gaussian input has a route section, a title, a charge and multiplicity line, and molecular coordinates. Blank lines separate these sections. For example:
%chk=water.chk
#p B3LYP/6-31G(d) opt
Water geometry optimization
0 1
O 0.000000 0.000000 0.000000
H 0.758602 0.000000 0.504284
H -0.758602 0.000000 0.504284
The first line is an optional checkpoint-file directive. The line beginning with # specifies the calculation. The text below it is the title, and 0 1 gives the total charge and spin multiplicity. The remaining lines are Cartesian coordinates. The final blank line is a useful way to mark the end of the molecule specification.
A missing blank line can cause Gaussian to read a title as part of the route section, or coordinates as part of the title or molecule specification. Check that there is a blank line after the route section and after the title. If you use a connectivity or Z-matrix specification, make sure its additional sections are separated as required for that input format.
Check route keywords and punctuation
The route section starts with # and contains a method, a basis set, and requested options. In the example, B3LYP/6-31G(d) specifies a method and basis set, while opt requests geometry optimization. Look for:
- Misspelled or unsupported keywords, basis-set names, and option names.
- Missing or extra parentheses in options such as
opt=(...)orscrf=(...). - Incorrect separators or a malformed method/basis expression.
- Text copied into the route line that is not a Gaussian keyword.
If the route spans multiple lines, keep it within the route section: Gaussian treats lines as part of the route until the next blank line. Do not insert the blank line that starts the title too early. When in doubt, reduce the route to a small valid calculation, then add options back one at a time. Consult the manual for the Gaussian version you are running if a keyword’s availability or exact syntax is uncertain.
Check charge, multiplicity, and coordinates
The charge and multiplicity line contains two integers, in that order. For a neutral water molecule in its singlet ground state, 0 1 is appropriate. The right values for another molecule depend on its total charge and electronic state; they are not interchangeable with atom coordinates.
Each Cartesian coordinate line normally gives an element symbol (or atomic number) followed by three numeric coordinates. Check for missing values, commas used in place of whitespace, stray punctuation, and misspelled element symbols. Avoid pasting typographic characters such as a long dash or nonstandard minus sign into numeric fields. Use plain text and ordinary ASCII characters where possible.
For example, a line such as H 0.0, 0.0, 1.0 may be rejected because the comma-separated format is not the standard whitespace-separated Cartesian form. Write H 0.0 0.0 1.0 instead.
Separate syntax errors from other failures
A syntax error means the input parser could not understand the job specification. It is different from a job that parses successfully but fails during the calculation. Messages about SCF convergence, optimization steps, memory, or missing files usually require a different diagnosis. First confirm that Gaussian accepted the input and started the requested calculation; then investigate those later failures separately.
If the reported line seems valid, check the characters immediately before and after it. A missing closing parenthesis, a stray quote, a pasted control character, or an earlier malformed option can shift where the parser reports trouble. Recreating the short route line by hand in a plain-text editor can help rule out invisible characters.
Common mistakes
- Putting the title directly after the route without a blank line. The title may be interpreted as route text.
- Leaving out the blank line after the title. The charge and multiplicity can then be read in the wrong section.
- Using a keyword from another program. Similar names in different quantum-chemistry packages do not guarantee compatible syntax.
- Treating every failed job as a syntax problem. A convergence failure occurs after input parsing and needs different troubleshooting.
- Changing many things at once. Make one correction, rerun, and check whether the reported error changes; this helps isolate the cause.
References
- Gaussian, Inc., Gaussian User’s Guide
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.