Organic structures depend on atom connectivity, not just molecular formula. Use normal valence patterns, functional-group knowledge and the degree of unsaturation to build a reasonable skeleton before adding lone pairs and charges.
Usually four bonds and no lone pairs in neutral closed-shell structures.
Nitrogen
Commonly three bonds and one lone pair, or four bonds with a positive formal charge.
Oxygen
Commonly two bonds and two lone pairs, or one bond with a negative formal charge.
Hydrogen
One bond and no lone pairs; never a central atom.
Halogens
Usually one bond and three lone pairs in neutral organic compounds.
Carbonyl carbon
A C=O double bond plus two additional bond orders around carbon.
How to build an organic Lewis structure
Interpret the formula or name.
A condensed formula such as CH3OH contains connectivity information that a formula such as CH4O alone does not fully specify.
Create the carbon framework.
Connect carbon atoms according to the name, condensed groups or expected chain/ring pattern.
Attach heteroatoms and hydrogens.
Use recognizable groups such as –OH, –NH2, C=O and –COOH.
Check carbon valence.
Each neutral carbon should total four bond orders.
Add multiple bonds when required.
Use the formula's degree of unsaturation and atom valences to place double bonds, triple bonds or rings.
Add heteroatom lone pairs and charges.
Complete octets, then calculate formal charges.
Formula ambiguity and isomers
A molecular formula is not always one structure. C2H6O can represent ethanol, CH3CH2OH, or dimethyl ether, CH3OCH3. C3H6 can represent propene or cyclopropane.
A formula-only generator cannot reliably infer which isomer the user intends. Names, SMILES strings, condensed structures or explicit atom connectivity provide better input.
Condensed formula to Lewis structure
Read the formula in groups. CH3CH2OH means CH3–CH2–O–H. Expand every carbon's hydrogens, then place two lone pairs on oxygen.
Skeletal structure to Lewis structure
In a skeletal drawing, every unlabeled line end and vertex is carbon. Add enough hydrogens to give each carbon four bond orders, then restore all lone pairs and charges on heteroatoms.