SMILES to Molecular Formula Converter – Formula, Molecular Weight and Exact Mass from Structure
A SMILES string writes a molecule as one line of text, and this SMILES to molecular formula converter turns that line into a Hill-order formula, molecular weight, monoisotopic mass, charge and degree of unsaturation. It also draws the structure and annotates the SMILES itself, so you can see where every implicit hydrogen came from. Everything runs in your browser. Proprietary structures are never uploaded or looked up.
Atoms, bonds, branches and ring closures
Letters are atoms, = and # are double and triple bonds, parentheses open a branch, and a digit written twice closes a ring. Ethanol is CCO, acetic acid is CC(=O)O and cyclohexane is C1CCCCC1. A dot separates parts that are not bonded, as in a salt.
The implicit hydrogen rule
Atoms written without brackets (B C N O P S F Cl Br I) get as many hydrogens as it takes to reach their next normal valence. In CCO each carbon has four bonds in total, so the methyl carbon gets 3 H, the CH₂ carbon gets 2 H and oxygen gets 1 H: C₂H₆O. The rule has a surprise. In N(=O)=O the nitrogen has a bond-order sum of 4, the next normal valence of nitrogen is 5, and so it receives one hydrogen. The result is HNO₂, not NO₂. The radical has to be written [N](=O)=O.
Lowercase atoms and why pyrrole needs [nH]
Lowercase c, n, o and s mark aromatic atoms. The converter checks that each aromatic ring can be drawn with alternating double bonds before it counts hydrogens. Benzene c1ccccc1 passes, but c1ccnc1 fails: five atoms cannot pair up. In pyrrole the nitrogen carries a hydrogen and no double bond, so it is written [nH], as in c1cc[nH]c1.
Bracket atoms: charges, isotopes and metals
Brackets switch off the implicit hydrogen rule. [NH4+] has exactly four hydrogens, [Na+] has none, and any element outside the organic subset, such as [Pt] or [Cu+2], must be bracketed. Isotopes go in front of the symbol: [2H] is deuterium and [13CH3] is a labelled methyl carbon.
[13C]1=CC=CC=C1 has no hydrogen, because bracket atoms get none for free. The tool gives C₆H₅ and warns you. Write [13CH]1=CC=CC=C1 for labelled benzene.Dots, salts and Hill order
The number of components is the number of connected pieces in the graph, not the number of dots, so C1.C1 is one molecule (ethane). Sodium acetate CC(=O)[O-].[Na+] has two components and an overall formula of C₂H₃NaO₂. Formulas follow Hill order: carbon first, then hydrogen, then the other elements alphabetically. Without carbon, every element is alphabetical, so sodium chloride is ClNa.
Molecular weight, monoisotopic mass and nominal mass
Molecular weight sums standard atomic weights and is the number for weighing and molarity. Monoisotopic mass sums the most abundant isotope of each element and is what a high-resolution mass spectrometer reports. The nominal mass is the integer sum of mass numbers. For a charged structure the tool also gives the ion m/z, with the electron mass included. Boron compounds are a quirk: their monoisotopic mass is above their molecular weight, because ¹¹B is the most abundant isotope and heavier than the average.
Rings plus π bonds versus formula DBE
The degree of unsaturation is shown two ways. The structural value counts rings and π bonds directly, for example DBE 6 = 1 ring + 5 π bonds for aspirin. The formula value uses (2C + 2 + N − H − X) / 2, the same calculation as the Molecular Formula Finder. They agree for neutral organic molecules and differ for ions, radicals and S=O or P=O bonds, and the tool says which reason applies.
CCO and dimethyl ether COC are both C₂H₆O. Use the formula to check your input, not to identify the compound.