Drawing the Lewis Structure for HCN
The first step is always counting valence electrons. Hydrogen gives you one, carbon gives four, nitrogen gives five. That is ten total. Write the atoms in order: H–C–N. Hydrogen never goes in the middle, so that arrangement is fixed. Carbon sits between them.Start with single bonds. That uses four electrons and leaves six. Fill the outer atoms first. Hydrogen is satisfied with two electrons, which it already has from the single bond. Nitrogen gets three lone pairs to use up the remaining six electrons. Now check the octets. Hydrogen is fine at two. Carbon only has four electrons around it. It needs eight. Nitrogen has eight, but carbon is short. The fix is to move lone pairs from nitrogen into bonding position. Take two pairs from nitrogen and make them a triple bond between carbon and nitrogen. Now carbon has two electrons from the single bond to hydrogen and six from the triple bond to nitrogen. Eight total. Nitrogen also has eight: six in the triple bond and two in its remaining lone pair. Formal charges are zero on every atom, which is the ideal outcome.
Hydrogen Cyanide Lewis Structure
Here is what the final structure looks like: H–CN with one lone pair on nitrogen. The molecule is linear, bond angle exactly 180 degrees. Carbon is sp hybridized. The triple bond consists of one sigma bond and two pi bonds between carbon and nitrogen. I ran into an edge case once with a student who tried to draw a double bond instead, giving C=N with two lone pairs on nitrogen and putting the extra electrons somewhere else to make the count work. It looked fine on paper until we checked formal charges. With a double bond, carbon gets a positive formal charge and nitrogen becomes negative. The triple bond version keeps everything neutral. That single check catches most wrong structures before they propagate through a homework assignment. One thing people miss: the lone pair on nitrogen matters more than it seems. In HCN it is not just sitting there. It is in an sp orbital pointing away from the carbon, and it is what makes cyanide a decent nucleophile in substitution reactions. When HCN acts as an acid and loses its proton, the resulting CN– ion has that lone pair ready to donate. The Lewis structure shows it, but the reactivity follows directly from where that lone pair lives spatially.
Another practical note. The standard Lewis model does not capture the bond polarity very well. Carbon and nitrogen are close in electronegativity, but the triple bond pulls electron density toward nitrogen in a way that simple formal charges hide. Computational chemistry shows the actual charge distribution is more nuanced. If you need accurate partial charges for a simulation or a mechanistic argument, stop at the Lewis structure and move to a DFT calculation or at least a molecular mechanics parameterization. The Lewis diagram is a sketch, not a measurement. The biggest limitation of this approach is that it tells you nothing about the energy of the molecule, the vibrational frequencies, or how it behaves under pressure. It answers one question and only one: how many electrons go where to satisfy the octet rule. For that single question it is fast and reliable. For everything else, you need something else. If you want to practice, grab a molecular modeling kit or use a free tool like Avogadro or ChemDraw. Build HCN, check the geometry comes out linear, and verify the bond lengths match experimental values around 1.06 angstroms for the C–N triple bond. That exercise takes about five minutes and cements the concept better than any diagram you will find online.
Get the Full Details

For reference, the IUPAC name is hydrogen cyanide. It is also called formonitrile or cyano hydride. The CAS number is 74-90-8. Store it properly and keep it away from anything basic, since cyanide salts form easily and those are the real toxicity concern in the lab. Khan Academy – Lewis Diagrams Tutorial LibreTexts – Molecular Geometry and Bonding