SMILES to 3D Coordinates (XYZ) with Force-Field Minimisation

Approximate 3-D structure from SMILES: XYZ and MOL with bond lengths, angles and energy.

A SMILES string (CCO, c1ccccc1, [NH4+]), a MOL/SDF V2000 block or XYZ coordinates. SMILES subset: organic atoms B C N O P S F Cl Br I and aromatic b c n o p s, bracket atoms with isotope, hydrogens and charge, bonds - = # :, branches, ring numbers and %nn, dots between parts. Stereo marks are read but not used. At most 300 atoms including hydrogens.

More options

Per start; minimisation stops earlier when the largest gradient is below 0.001 kcal/mol/Å.

Different seeded start geometries; the one with the lowest energy is kept.

Atom numbers of the result (hydrogens come after the heavy atoms): two for a distance, three for an angle, four for a dihedral, separated by commas.

Try an example: · · · ·

More about this tool

Part of Proofline

How it works

Turn a SMILES string or a 2-D MOL file into approximate 3-D coordinates: hydrogens are added, a start geometry is built from the 2-D layout and relaxed with a small UFF-style force field by conjugate gradients or steepest descent. You get XYZ and MOL files, the force-field energy by term, bond-length statistics, a ball-and-stick picture and any distances, angles or dihedrals you ask for. Approximate geometry, not quantum chemistry. Part of the Proofline math notebook and its Molecule Lab.

  • Hydrogens are added, the 2-D layout (stress majorisation, then bond and angle refinement) gives x and y, and a seeded jitter gives z; hydrogens start away from their neighbours. Each start is first relaxed with soft repulsion only, then with the full force field.
  • Force field (UFF-inspired subset): bond stretch k(r − r₀)² with r₀ from Pyykkö’s single, double and triple covalent radii (aromatic in between); angle bend in cos θ with natural angles 109.47°/120°/180° from the hybridisation (UFF values for O, N, S, P in sp³, 60° and 88° in three- and four-membered rings); UFF-form torsions (3-fold sp³–sp³, 2-fold across double and aromatic bonds, 6-fold sp²–sp³); a planarity term for sp² centres; Lennard-Jones 12-6 with UFF van der Waals parameters for atoms three or more bonds apart (1-4 pairs halved).
  • Minimisation: Polak–Ribière+ conjugate gradients with a backtracking line search and restarts, or steepest descent; it stops when the largest gradient component is below 0.001 kcal/mol/Å. The structure is centred and turned so its longest extent lies along x.
  • Approximate geometry, not quantum chemistry: no charges, no solvent, no stereo; expect bond lengths within about ±0.03 Å and angles within a few degrees of experiment, and a local energy minimum (conformers are not searched).

Force-field geometries are approximate and the energy is only meaningful to compare conformations of the same molecule. Nothing here is advice on handling chemicals safely.

Sources

Part of Proofline

  • Proofline Math notebook

    Solve, graph, test and visualise in one notebook — with data, findings and a report.

    Open Proofline

Related tools

How to turn SMILES into 3-D coordinates (XYZ) with a force field

Build an approximate 3-D structure from SMILES, relax it with a small force field and read bond lengths, angles, dihedrals and XYZ or MOL files.

What it is for

A SMILES string says which atoms are bonded, not where they sit in space. This tool makes a 3-D structure from it: it adds the hydrogens, starts from a flat 2-D layout lifted slightly out of the plane, and then relaxes the geometry with a small force field until the forces vanish. You get XYZ and MOL files you can open in other programs, a ball-and-stick picture, bond-length statistics, the force-field energy split into its terms, and any distances, angles or dihedrals you ask for.

It is meant for teaching, quick sketches and as a starting geometry for other software. It is approximate geometry, not quantum chemistry: there are no charges, no solvent and no search over conformations.

Worked example

Enter CCO (ethanol) and measure 2-3, 1-2-3. Atoms are numbered in the order of the SMILES, with the hydrogens after the heavy atoms, so 1 and 2 are the carbons and 3 is the oxygen. The result has 9 atoms, a force-field energy of about 0.85 kcal/mol, and reports the C2–O3 bond at 1.387 Å and the C1–C2–O3 angle at 109.6°. Experiment gives about 1.43 Å and 108°, which shows the size of the approximation.

Benzene, c1ccccc1, comes out flat: every C–C bond is 1.408 Å, every ring angle 120.0° and the C1–C2–C3–C4 dihedral 0°. Butane, CCCC, relaxes to the anti chain with a C1–C2–C3–C4 dihedral of 180°. Water by steepest descent ends with an H–O–H angle of 104.5°.

How to read the result

The force-field energy is in kcal/mol and only means something relative to other geometries of the same molecule; it is not a heat of formation. The table of energy terms shows where the strain sits: bond stretching, angle bending, torsions, the planarity term for double-bonded and aromatic atoms, and van der Waals contacts.

Converged means the largest force fell below 0.001 kcal/mol/Å. If it says no, raise the maximum number of iterations. Bond lengths are grouped by element pair and bond type (– single, = double, ≡ triple, ⋯ aromatic) with the shortest, mean and longest value.

Measurements use the atom numbers of the result. A dihedral of 0° means the four atoms are eclipsed, 180° anti; the sign follows the IUPAC convention.

Tips and common mistakes

  • Several starting structures (default 3) lower the chance of ending in a poor local minimum; the lowest energy wins.
  • Conjugate gradients usually needs far fewer iterations than steepest descent; both reach the same minimum for small molecules.
  • Chirality and cis/trans marks are ignored, so you may get the mirror image or the other double-bond isomer.
  • Atoms with more than four neighbours and metals keep only bond lengths and repulsion; their angles are not shaped.
  • At most 300 atoms including hydrogens; big molecules are better handled by dedicated software.

FAQ

Which force field is it?

A small UFF-style set of terms written for Proofline: bond lengths from Pyykkö's covalent radii for each bond order, natural angles from the hybridisation, UFF-form torsions, a planarity term and UFF van der Waals parameters. It is documented in the methodology above.

How accurate are the bond lengths?

Typically within about 0.03 to 0.05 Å of experiment and angles within a few degrees. C–O and C–H come out a little short.

Can I use the result in other programs?

Yes. Download the XYZ or MOL file; the MOL file contains the bonds with alternating single and double bonds for aromatic rings.

Does Proofline show the molecule in 3-D?

Yes. The Molecule Lab view runs this calculation in your browser and lets you turn, zoom and measure the structure.

Guide last updated:

For scripts and AI agents

  • JSON API: POST https://prooflinemoleculegeometry.usefulweb.app/api/v1/calculate (same calculation as this page)
  • Interface description: OpenAPI 3.1 · AI guide: llms.txt
  • MCP server (Streamable HTTP): https://prooflinemoleculegeometry.usefulweb.app/mcp · tool name proofline_molecule_geometry
Example request
curl -s -X POST https://prooflinemoleculegeometry.usefulweb.app/api/v1/calculate \
  -H 'content-type: application/json' \
  -d '{"structure":"CCO","measure":"2-3, 1-2-3"}'
Feedback · ideas & bug reports welcome