Skip to content

Structure validation and cleanup

Validation checks every atom as you draw and marks atoms whose bonds or charges do not make sense. For example, a nitrogen drawn with four bonds and no charge gets a marker, because it only makes sense as an ammonium ion. Validation is on by default. Structure > Clean Up Structure moves atoms toward standard bond lengths and angles, so that a quick sketch looks drawn to scale.

For example, to see validation catch a missing charge on the nitrogen of tetramethylammonium:

  1. With the Bond tool, draw a central atom with four single bonds to four neighbors. To make the central atom nitrogen, hover over it and type N (see Atoms and elements).
  2. A marker appears next to the N, and the amber badge in the status bar shows the number of issues.
  3. Hover over the marker. The message says that the atom is drawn neutral but its bonds and lone pairs give a formal charge of +1.
  4. To fix it, click the marker and click Set charge to +1, or add a + charge to the nitrogen with the charge tool. The marker and the badge disappear.

Clicking a marker opens its message, with See all issues and, for a charge warning, Set charge to the computed charge.

A nitrogen with four bonds to methyl groups, drawn with no charge, and an amber warning triangle with an exclamation mark beside the N.
A neutral nitrogen with four bonds gets a warning marker.

Validation runs on each atom and reports four kinds of issues.

Issue Reported as Example message Not flagged
Valence Error above the element’s maximum; warning for an unusual but possible count “C has 3 bonds + 2 unpaired electrons” Transition and f-block metals; a carbene carbon (CH2, CCl2)
Too many electrons Error “N has 10 electrons around it; a second-period atom holds at most 8 (an octet)” Atoms in the third period and below (S, P, Cl), which may expand their octet
Charge mismatch Warning “drawn neutral but its bonds and lone pairs give a formal charge of … add a charge?” or “O has 6 electrons around it (an octet is 8): a lone pair missing?” A neutral atom with a dative bond; an atom that already has an error
Coincident atoms Error Bonded atoms at one spot (a Newman projection’s two carbons)

How each check counts:

  • Valence compares the total bond order on an atom with the element’s accepted valences (C: 4; N: 3 to 5, though a second-period N with five bonds then fails the electron check; O: 2, 3; S: 2, 4, 6). Each unit of positive charge allows one bond fewer, and each unit of negative charge one bond more. Pentavalent carbon and a hydrogen with more than one bond are always errors. A metal is skipped because its number of ligands (Ni(CO)4, [Fe(CN)6]4−) is not a valence.
  • Too many electrons counts the shared pairs of the atom’s bonds and hydrogens, its lone pairs, and its unpaired electrons: at most 2 for hydrogen, 8 for Li to Ne. A drawn charge does not change the count, so the error stays after you add a charge.
  • Charge mismatch compares the drawn charge with the formal charge from the bonds, lone pairs, and element, and shows both. When a neutral N, O, or F has fewer than 8 electrons and every hydrogen is drawn, a missing lone pair is the likelier mistake, so the message asks about that instead. A charge drawn on an atom with a dative bond is still checked.
  • Coincident atoms are two unbonded atoms within 1 px of each other, where one hides the other.

A common way to draw an ion is with every atom neutral, brackets around the structure, and the net charge written outside, for example nitrate as [NO3]−. Validation recognizes this. A standalone charge belongs to a structure when it is in the same named selection or set, inside a bracket around the structure, or close beside it. When its value equals the sum of the formal charges calculated for that structure, validation drops the “drawn neutral” warnings on the atoms of the structure. If the bracket charge does not match the electrons you drew, the warnings stay; this usually points to a missing or extra lone pair.

When a set holds several drawings of the same ion, each with its own charge label, each label is matched to the drawing it sits beside.

Whether lone pairs you did not draw count as missing depends on whether the structure is a Lewis structure (tagged with Set Category > Lewis, or a form in a resonance set) or a bond-line or other drawing; see How lone pairs are counted.

Validation does not check generic placeholders such as R and X, because they have no defined valence or charge.

The charge check also skips an atom whose label stands for a whole group, such as OTs, OMe, Boc, or COOH. Only a label that is the element with its hydrogens (OH, NH2, CH3, H3C) is checked. For example, an OTs label drawn with no lone pairs is not reported as a +4 oxygen.

Issues appear in three places.

  • On the canvas. An atom with an issue gets a small triangle with an exclamation mark next to its label: red for an error, amber for a warning. To read the message, hover over the marker; click it for the fix.
  • In the status bar. An amber triangle with the number of issues appears whenever there is at least one issue. To open the Structure Validation panel, click it.
  • In the Structure Validation panel. To open the panel, click the status bar badge or select Structure > Validate Structure…. The panel floats above the status bar, lists every issue with the atom label and message, and shows the total in its header. Click an entry to center the canvas on that atom and select it. The list updates as you edit.

Validation markers are on by default in every built-in structure preset.

  • To hide them, click Toggle Validation Warnings (the warning triangle in the action bar) or select Structure > Show Validation Warnings. The status bar badge hides with them.
  • Opening the Structure Validation panel turns them back on.
  • Both commands are also in the command palette (Ctrl+K).
  • The setting is saved with the document.

Validation only displays issues. It never blocks drawing or changes your structure, so you can leave warnings unresolved while you work.

Structure > Clean Up Structure makes isolated rings regular, sets standard bond lengths, straightens nearly straight chains, sets chain and branch angles to 120° (180° at a linear center), and separates overlapping atoms, in each connected molecule separately. The molecule and its stereocenters stay the same, and a clean drawing is left as it is. For the passes and their thresholds, see How Clean Up Structure decides what to move.

Cleanup moves atoms only. Arrows, text, shapes, and other annotations stay where they are, and bond orders, charges, and labels do not change. Isolated single atoms are skipped. If the structure is already within tolerance, the command changes nothing and adds nothing to the undo history.

A full cleanup is one undo step. To return every atom to its previous position, press Ctrl+Z once.

Clean Up Structure redraws a structure. For small slips only, use Structure > Straighten Bonds instead: it puts bonds that are up to 2° off a 15° line back on that line and changes no other bond angle. See Straightening bonds.

To line up or distribute whole molecules and annotations, use the Arrange commands instead.