# SMILES to Structure - Draw Molecules and Get Formula, Mass & Functional Groups

> Free online SMILES viewer: draw a 2D skeletal structure and get the formula, molar and exact mass, unsaturation, rings, H-bond counts and a Lipinski check.

- URL: https://qilingtools.com/en/math/smiles
- Category: Math Tools (https://qilingtools.com/en/math)
- Tags: [Math](https://qilingtools.com/en/tags/math), [Chemistry](https://qilingtools.com/en/tags/chemistry)
- Last updated: 2026-10-26
- Price: Free, no sign-up
- Privacy: Runs locally in the browser; files are never uploaded

SMILES (Simplified Molecular Input Line Entry System) encodes a molecule as one line of text: uppercase letters are aliphatic atoms, lowercase letters aromatic atoms, = and # mark double and triple bonds, parentheses open branches and paired digits close rings. Aspirin, for example, is CC(=O)Oc1ccccc1C(=O)O. After filling in implicit hydrogens from default valences, this tool reports C₉H₈O₄, a molar mass of 180.16 g/mol, a monoisotopic mass of 180.0423 u and a degree of unsaturation DBE = 1 + 9 − 8/2 = 6 (four for the benzene ring, one for each C=O), and it recognises the carboxylic acid, ester and benzene ring. The parser handles bracket atoms (isotopes like [13C], charges like [NH4+], explicit H, @/@@ chirality), the bond symbols - = # : / \, two-digit %nn ring closures and dot-separated salts or mixtures. The 2D drawing comes from a self-written layout: rings as regular polygons, fused rings sharing edges, chains as 120° zig-zags and an overlap clean-up, with aromatic rings shown as Kekulé bonds or inner circles. You also get SSSR ring count, heavy atoms, Lipinski H-bond donors and acceptors, rotatable bonds and a check of the molecular-weight, HBD and HBA rules. Everything runs locally in your browser, with about 30 presets such as caffeine, ibuprofen, glucose, cholesterol and penicillin G.

## How to use

1. Type or paste a SMILES string, or pick a common molecule such as aspirin, caffeine or cholesterol
2. Inspect the 2D skeletal structure; switch aromatic style and toggle carbon labels, atom numbers and stereocentre marks
3. Read the formula, masses, unsaturation, functional groups and Lipinski check, then export SVG/PNG or copy the formula

## Features

- Full SMILES parsing: bracket atoms, isotopes, charges, explicit H, @/@@ chirality, %nn ring closures, dot-separated components
- Implicit hydrogens from default valences; aromatic rings kekulized into alternating bonds
- Self-written 2D layout: polygon rings, fused and spiro systems, 120° zig-zag chains, overlap correction
- Hill formula, average molar mass, monoisotopic exact mass and degree of unsaturation
- SSSR and aromatic ring counts, heavy atoms, H-bond donors/acceptors, rotatable bonds
- Detects 20+ functional groups: acids, esters, amides, aldehydes, ketones, alcohols, phenols, ethers, 1°/2°/3° amines, nitriles, nitro, halides, alkenes, alkynes, aromatic rings, thiols and more
- Lipinski rule-of-five check (MW, HBD, HBA)
- SVG and high-resolution PNG export, copy formula or SMILES, jump to the isotope pattern calculator

## FAQ

### How do I write a SMILES string?

Write atoms as element symbols. Common organic atoms (B, C, N, O, P, S, F, Cl, Br, I) can be written bare; anything else, or any atom with a charge or isotope, goes in brackets such as [Na+], [13C] or [nH]. Neighbouring atoms are single-bonded by default, = is a double bond and # a triple bond. Parentheses make branches, e.g. isopropanol CC(O)C. A digit used twice joins those two atoms into a ring, e.g. cyclohexane C1CCCCC1. Lowercase letters are aromatic atoms, e.g. benzene c1ccccc1, and a dot separates unconnected parts, e.g. sodium acetate CC(=O)[O-].[Na+].

### How are implicit hydrogens calculated?

Atoms outside brackets get hydrogens up to the lowest default valence that fits their bonds: C 4, N 3 or 5, O 2, S 2, 4 or 6, P 3 or 5, B 3 and halogens 1. In CCO the carbons get 3 and 2 hydrogens and the oxygen 1, giving C₂H₆O. Aromatic atoms use one valence for the π system, so pyridine's n has no H while pyrrole's NH must be written [nH]. Bracket atoms carry only the hydrogens written inside the brackets.

### What does the degree of unsaturation tell me?

The degree of unsaturation (DBE, double-bond equivalents) equals the number of rings plus π bonds: DBE = 1 + Σ nᵢ(vᵢ − 2)/2, which for CₓHᵧNₙOₘ is x − y/2 + n/2 + 1. A benzene ring contributes 4 (one ring plus three C=C), a carbonyl 1 and a triple bond 2. C₉H₈O₄ has DBE 6, matching aspirin's benzene ring and two C=O groups.

### Why do some structures look distorted?

The layout is a simplified algorithm written for this tool: polygon rings, fused rings unfolded along shared edges, zig-zag chains and an overlap clean-up by mirroring and small rotations. It works well for chains, single rings and fused systems such as naphthalene, steroids and indoles, but heavily bridged or macrocyclic molecules like adamantane or morphine can come out distorted or overlapping. Only the drawing is affected; formula, masses and functional groups are computed exactly from the molecular graph. Wedge bonds are not drawn and @/@@ are marked without assigning R/S.

## Related tools

- [Graphing Calculator](https://qilingtools.com/en/math/graph): Free online function graphing calculator: type sin(x), x^2 or 1/x and see the curve at once, with several functions, parametric and polar curves, PNG export.
- [Scientific Calculator](https://qilingtools.com/en/math/calculator): Free online scientific calculator: type 2*(3+4)^2, sin(pi/6) or log(8,2) and see the answer as you type, with degrees or radians and a history list.
- [Equation Solver](https://qilingtools.com/en/math/equation): Free online equation solver: enter coefficients for linear, quadratic (with discriminant, vertex and complex roots) and cubic equations, plus 2×2 systems.
- [Fraction Calculator](https://qilingtools.com/en/math/fraction): Free online fraction calculator: add, subtract, multiply and divide fractions with automatic reduction, plus fraction ↔ decimal with repeating digits.
- [Percentage Calculator](https://qilingtools.com/en/math/percentage): Free online percentage calculator: X% of Y, X as a percent of Y, increase and decrease, a value after a percentage change and the original behind it.
- [Prime Factorization](https://qilingtools.com/en/math/prime): Free online prime factorization: factor an integer with exponents, list every divisor and their sum, test primality with neighbouring primes, or list a range.
- [GCD and LCM](https://qilingtools.com/en/math/gcd-lcm): Free online GCD and LCM calculator: works with two or more integers, says whether they are coprime, shows each prime factorization and every Euclidean step.
- [Statistics Calculator](https://qilingtools.com/en/math/statistics): Free online statistics calculator: paste a data set for the mean, median, mode, range, quartiles, variance, standard deviation, standard error and outliers.
