Resonance: The Concept of Delocalization
Draw a Lewis structure for the acetate ion. You must place a formal negative charge, a C=O double bond, and a C–O single bond on two oxygens. Yet any spectroscopic measurement tells you these oxygens are completely identical. Both C–O bonds in acetate have the same length, roughly 1.25 Å. This sits almost exactly halfway between a typical C=O double bond (1.20 Å) and a typical C–O single bond (1.34 Å). No single arrangement of dots and lines drawn on paper can capture this. The molecule is not flickering between two forms. Instead, it exists, permanently, as something in between. Organic chemistry needs a language to describe that "in between." That language is resonance. Resonance is not a physical process — nothing is actually moving back and forth. It is a bookkeeping device. It acknowledges that a single Lewis Structures: Rules and Construction fails when electrons are shared over more than two atoms. Quantum mechanically, some electrons occupy molecular orbitals that spread over three, four, or more nuclei. A Lewis structure can only show a bond between two atoms at a time. So we draw several Lewis structures — resonance contributors — and mentally superpose them. The real molecule, the resonance hybrid, is a weighted average of these contributors. It is always lower in energy and more stable than any single contributor could suggest. This idea is not decorative. It is the mechanistic backbone behind several key facts. It explains why carboxylic acids are far more acidic than alcohols. It explains why aniline is a weaker base than cyclohexylamine. It explains why phenol reacts at its ortho/para positions. It explains why amide nitrogens are poor nucleophiles and amide bonds resist rotation. It also explains why benzene fails to undergo the addition reactions typical of alkenes. Every one of these facts is a direct consequence of delocalized π electrons spread over multiple nuclei. Such delocalization is describable only by a resonance hybrid. This article builds the concept from first principles. It explains why a single structure fails, and gives the formal rules for drawing legitimate contributors. It shows how to read the hybrid off a set of contributors qualitatively. It also connects these ideas to the language of Formal Charge you already know. It sets up, but does not yet fully develop, the electron-pushing formalism of Curved Arrows for Resonance. It also sets up the ranking criteria used in Evaluating Resonance Structures.
- A single Lewis structure using only localized 2-center-2-electron bonds cannot represent electron density spread over three or more atoms.
- Resonance structures are alternative, hypothetical Lewis structures for the same molecule with the same atomic connectivity and nuclear positions.
- The real molecule — the resonance hybrid — is a weighted quantum mechanical superposition of contributors, not an equilibrium mixture or a time-average.
- Only π electrons and lone pairs adjacent to π systems (or empty p orbitals) can delocalize; σ bonds and atomic positions are frozen in every contributor.
- Delocalization is always stabilizing: the hybrid's energy is lower than any single contributor's energy, an effect called resonance (or delocalization) stabilization.
- Key idea: when electron density genuinely spans more than two atoms, describe it with a family of legitimate Lewis structures related by electron reshuffling alone, and treat the true structure as their weighted composite.
A single Lewis structure is a snapshot of localized bonds; whenever p orbitals on three or more adjacent atoms overlap, electrons occupy delocalized molecular orbitals that no single snapshot can depict — so we superpose several legitimate snapshots (resonance structures), all with fixed nuclei and identical connectivity, differing only in where the π electrons and lone pairs are drawn.
Where this lives today
Resonance delocalization is not a historical curiosity confined to introductory courses — it is the working explanation behind entire classes of modern chemistry and biology. Amide bond planarity and restricted rotation, a direct consequence of nitrogen lone-pair delocalization into the adjacent carbonyl (giving partial C–N double-bond character, rotational barriers around 15–20 kcal/mol), underlie the rigid, well-defined secondary structure of every protein backbone and is exploited deliberately in peptidomimetic drug design, where chemists lock amide-like bonds into specific geometries to mimic or block protein-protein interactions. Carboxylate and phosphate resonance delocalization (the latter spread over three or four oxygens in phosphate esters) governs the stability and reactivity of nucleic acid backbones and of high-energy phosphate bonds in ATP, where the difference in delocalization stabilization between ATP and its hydrolysis products contributes to the thermodynamics that power the cell. In materials science, extended conjugated resonance across polyene and polyaromatic backbones (delocalization spread over dozens of atoms) is the entire operating principle of organic semiconductors, OLED emissive layers, and conductive polymers such as polyacetylene and polythiophene, where charge carriers move by hopping through continuously overlapping p-orbital networks exactly analogous to, but vastly extended from, the three-atom allyl system developed here. Drug design routinely uses resonance reasoning to predict which nitrogen in a heterocycle is basic (an sp³-like pyridine-type lone pair not delocalized into the ring versus a pyrrole-type lone pair fully committed to aromaticity and therefore non-basic) — a distinction that determines protonation state, solubility, and membrane permeability of countless pharmaceuticals. Every discussion of aromaticity, enolate and enamine reactivity, phenol and aniline substituent effects, and carbonyl electrophilicity that follows this concept rests on the resonance framework built here.
Ask the tutor: How do I rank which resonance structure contributes most to the hybrid when several legal contributors have different formal charges or different atoms bearing them?
The physical picture
Start with formaldehyde, H₂C=O, an entirely ordinary molecule with one dominant Lewis structure: a C=O double bond, no formal charges, two lone pairs on oxygen. This is a good description because the π electrons genuinely sit in a bonding orbital built from carbon's 2p_z and oxygen's 2p_z, localized over exactly two atoms. One structure, one bond, no problem. Now compare the formate ion, HCO₂⁻. Here oxygen's lone pair on one oxygen, the C=O π bond, and the empty-looking single-bonded oxygen's lone pairs all involve p orbitals on three adjacent atoms — the two oxygens and the carbon between them — all aligned in parallel, all overlapping into one continuous π system. Quantum mechanically the correct picture is molecular orbitals built from three p_z orbitals (O, C, O), and the highest-energy occupied one of these has substantial amplitude on both oxygens simultaneously. A single Lewis structure, which insists on drawing one full C=O bond and one full C–O⁻ bond, arbitrarily localizes electron density on one oxygen when the true orbital does not. Drawing the mirror-image structure (double bond to the other oxygen) is equally arbitrary, and equally partial. Superposing the two captures what neither can alone: equal C–O bond character, and the negative charge shared equally between both oxygens. The orbital-level reason resonance exists at all is simple: Lewis structures are drawn as if every bonding pair of electrons occupies an orbital built from exactly two atomic orbitals (a localized 2-center-2-electron, or 2c–2e, bond). But real π systems with conjugated multiple bonds, or lone pairs adjacent to π bonds or empty p orbitals, generate molecular orbitals built from three, four, or more atomic p orbitals — 3-center-4-electron systems and larger. No single 2c–2e picture can represent a delocalized (multi-center) orbital; you need a set of 2c–2e pictures whose superposition approximates it.
The measured C–O distance in formate, about 1.25–1.27 Å by electron diffraction and crystallography, sits almost exactly between the localized double- and single-bond values (1.20 Å and 1.34 Å), and both oxygens carry equal charge — direct experimental confirmation that the hybrid, not either contributor, is real. A second concrete picture: the allyl cation, CH₂=CH–CH₂⁺. Here the empty p orbital on the terminal carbocation carbon is adjacent to the π bond, so all three p orbitals (empty, filled π, empty-again) are parallel and overlapping — a 3-center-2-electron π system. The two Lewis structures put the positive charge on C1 or on C3; neither is correct alone, but NMR shows the two terminal carbons are equivalent and each carries roughly +0.5 charge, and both C–C bonds have partial double-bond character (~1.40 Å, between a 1.54 Å single bond and 1.34 Å double bond).
The core ideas
Delocalization requires a continuous, parallel array of p orbitals — from π bonds, lone pairs in p orbitals, or empty p orbitals — on three or more contiguous atoms. The energetic lowering achieved by spreading electrons over this array, relative to the best single localized structure, is the resonance stabilization energy, :
where:
- is the experimentally measurable energy (heat of formation, heat of hydrogenation) of the real molecule,
- is a hypothetical energy computed or estimated as if that one Lewis structure were the true, localized structure,
- always, since delocalization only ever lowers energy (adding basis functions/mixing configurations cannot raise the ground-state energy — a direct consequence of the variational principle).
The weight (contribution) each resonance structure carries toward the true hybrid is qualitative, not something read off with a simple formula, but it obeys an ordering principle rooted in relative energy:
where:
- is the qualitative "importance" or weighting of contributor in the hybrid,
- is the estimated relative energy of that contributor if it existed as an isolated, real structure (found using the criteria of formal charge, electronegativity, octets, developed fully in evaluating resonance structures),
- this expression is written only to convey the intuition — lower-energy contributors matter more — and must never be used as a literal thermodynamic equilibrium; there is no actual interconversion or population dynamics between contributors.
A cleaner, load-bearing relationship is the bond-order/bond-length correlation used to test whether a proposed hybrid is real:
where:
- is the experimentally measured bond length,
- is the reference single-bond length, the reference double(or higher)-bond length between the same atom types,
- is the effective bond order predicted by averaging over resonance contributors (e.g., if two equally weighted contributors give one single + one double bond),
- is the bond order of the fully multiple bond reference ( for single/double averaging).
For formate with two equally-weighted contributors, , (C–O single), (C=O double), :
which matches the experimental C–O distance in formate (1.25–1.27 Å) closely, confirming the two-contributor hybrid model.
Goal. Show explicitly why three overlapping p orbitals cannot be represented by one Lewis structure, and why a superposition of two is the minimal fix, using the allyl anion, CH₂=CH–CH₂⁻, as the concrete system (isoelectronic in π count with the allyl radical treatment, but simpler to reason about with a full electron pair).
Step 1 — Build the atomic orbital basis. Each of the three sp²-hybridized carbons contributes one unhybridized 2p_z orbital perpendicular to the molecular plane: label them on C1, C2, C3. These three atomic orbitals are all parallel and mutually overlapping (each adjacent pair overlaps directly, and even the 1,3-orbitals have some through-space proximity in the planar, roughly 120° geometry). Four π electrons occupy this system (two from the original C=C π bond, two from the carbanion lone pair).
Step 2 — Combine into molecular orbitals. Simple Hückel treatment of a linear 3-orbital system gives three π molecular orbitals:
With four π electrons, both and are doubly occupied.
Step 3 — Read off where the electron density sits. has amplitude on all three carbons (bonding, most density on C2 in this filled combination for the anion case), while , the nonbonding orbital, has zero coefficient on C2 and equal-magnitude, same-sign-or-opposite coefficients on C1 and C3 only. This nonbonding orbital is the key: its electron pair sits entirely on the terminal carbons, with none on the central carbon, and split equally between C1 and C3.
Step 4 — Show why one Lewis structure cannot depict this. A Lewis structure draws bonding pairs strictly between two adjacent atoms. To depict 's electron pair, localized as it is over two non-adjacent atoms (C1 and C3, which are not directly bonded), you cannot draw a single bond line — there is no C1–C3 σ or π bond in this connectivity. The only way to represent "half a lone pair's worth of density on C1, half on C3, none on C2" using legal 2-center bond-and-lone-pair symbols is to draw two structures — one with the full lone pair (and negative charge) on C1, another with it on C3 — and declare that the truth is their average.
Step 5 — Conclude. The nonbonding molecular orbital is the delocalized lone pair; its charge density (each terminal carbon carrying half a negative charge in the anion) is exactly reproduced by averaging the two resonance structures with equal weight, because both terminal carbons are related by the mirror symmetry of the molecule and must carry identical charge. This is why the allyl anion's two resonance structures are drawn with a double-headed resonance arrow (↔), never an equilibrium arrow (⇌): there is only one molecule, one , and two necessary partial pictures of it.
Go deeper · Derivation B · 3 minConstructing legitimate resonance structures — the four inviolable rules, derived from what a Lewis structure is allowed to mean
Goal. Establish, from the definition of a Lewis structure as a representation of nuclear positions plus electron pairs, exactly which modifications between two structures preserve "same molecule" status and which produce a different species entirely (an error, not a resonance structure).
Step 1 — Nuclei must not move. A Lewis structure encodes a specific molecular skeleton: which atoms are bonded to which (σ framework) and their approximate 3-D arrangement. Resonance structures differ only in the placement of π electrons and lone pairs — never in which atoms are bonded to which. If you move an atom, or break and reform a σ bond, you have drawn a constitutional isomer or tautomer, not a resonance structure. (Tautomers, like keto and enol forms, are related by actual bond reorganization and atom/proton movement — real, interconverting, separable-in-principle species, fundamentally different from resonance contributors, which are not separable at all because there is only one real structure.)
Step 2 — Only electrons in p orbitals move, and only into adjacent, aligned empty or partially-filled p orbitals. Legal electron reorganizations are: (a) shifting a π bond to an adjacent position, (b) donating a lone pair into an adjacent empty p orbital or π* orbital, (c) shifting a π bond to become a lone pair on an adjacent atom (with charge appearing there). Every arrow-pushing step (formalized fully when you study curved arrows for resonance) must terminate on an atom that already has, or is generating, an available p orbital lobe pointed the right way. σ bonds and σ lone pairs (e.g., an sp³ lone pair pointed away from the π system) do not participate.
Step 3 — The total electron count and total charge must be conserved. Every legitimate resonance structure of a given species has the same number of total electrons and the same overall net charge as every other. If pushing an arrow changes the total electron count, you have made a bookkeeping error (most commonly, drawing both electrons of a bond disappearing without reappearing anywhere, or forgetting to update a formal charge, using Formal Charge rules, when a lone pair becomes a bond or vice versa).
Step 4 — Each contributor must be, in isolation, a chemically reasonable Lewis structure. Every atom must satisfy the normal valence/octet expectations (with recognized exceptions: expanded octets for period 3+ elements, incomplete octets for boron/aluminum-type centers, or odd-electron radicals when the real species is a radical). A structure that puts ten electrons around carbon, or that separates charges of the same sign onto adjacent atoms with no compensating benefit, is a poor or illegitimate contributor and will be down-weighted or excluded (the full ranking rules belong to evaluating resonance structures, but the requirement of basic chemical validity for even drawing a contributor belongs here).
Step 5 — Assemble and check. Applied to nitrate, NO₃⁻: nitrogen is bonded to three oxygens (σ framework fixed, never redrawn). Placing the formal N=O double bond on any one of the three oxygens, with the other two as N–O⁻ single bonds, generates three legitimate resonance structures related purely by shifting which π bond exists and which two oxygens hold the negative formal charge — nuclei fixed, connectivity fixed, electron count conserved (24 valence electrons in every structure), each individually a valid Lewis structure (N: four bonds + no lone pair, or three bonds + reasonable formal charge of +1, each O either two bonds/two lone pairs neutral or one bond/three lone pairs with –1). The hybrid has all three N–O bonds equal, each measured at 1.24 Å (between 1.36 Å single and 1.18 Å double N–O references), and each oxygen carrying –⅓ formal charge — exactly the average of "two oxygens at 0, one at –1" taken three ways.
Worked examples
Example 1 — Foundational: the carbonate ion, CO₃²⁻, and quantitative bond-order averaging. Carbonate has a central carbon bonded to three oxygens, total valence electrons . A first Lewis structure places one C=O double bond and two C–O⁻ single bonds: Carbon: 4 bonds, no lone pairs, formal charge . Double-bonded oxygen: 2 bonds + 2 lone pairs, formal charge . Each single-bonded oxygen: 1 bond + 3 lone pairs, formal charge . Total charge check: ✓, matching the ion's actual charge. By the symmetry rule from Step 5 above (the σ framework has three-fold symmetry — all three C–O σ bonds are equivalent by rotation), there are three equally valid resonance structures, each differing only in which oxygen bears the double bond. Since no electronic or steric feature distinguishes the three oxygens, all three contributors are equally weighted ( each), and the hybrid bond order for every C–O bond is:
Using the bond length interpolation with C=O reference 1.20 Å, C–O reference 1.34 Å, :
The experimental C–O bond length in carbonate is 1.29 Å (X-ray crystallography of carbonate salts) — an exact match, and strong quantitative support for treating the hybrid as an equal-weighted average of three contributors. Each oxygen's average formal charge is , consistent with total charge ✓.
Limiting case check: if you (incorrectly) imagined only one resonance structure existed (ignore delocalization), you would predict two different C–O bond lengths, 1.20 Å and 1.34 Å, and two different oxygen environments — contradicted immediately by carbonate's measured symmetry (single ¹³C NMR oxygen environment, single bond length). The three-contributor average is required, not optional.
Example 2 — Applied: why carboxylic acids are acids and why the carboxylate, not the alkoxide analog, is so stable. Compare acetic acid's conjugate base, acetate (CH₃CO₂⁻), with ethanol's conjugate base, ethoxide (CH₃CH₂O⁻). Both come from removing a proton from an O–H bond; the acidity difference (acetic acid ; ethanol ) is a difference of about 11 units, corresponding to
more favorable deprotonation for acetic acid. Mechanistically: ethoxide's negative charge is localized entirely on one oxygen — there is no adjacent π system or empty p orbital for that lone pair to delocalize into, so ethoxide is described by a single Lewis structure and bears its full –1 charge on one atom (a high-energy, poorly stabilized state). Acetate's carboxylate oxygen lone pair, by contrast, sits adjacent to the C=O π bond; both oxygens' lone pairs and the π bond form a 3-center-4-electron array exactly like formate above. Two equally-weighted resonance structures place the negative charge on either oxygen, so the true charge on each is –½, and both C–O bonds are 1.25 Å (measured), not one at 1.20 Å and one at 1.34 Å. This delocalization lowers acetate's energy substantially relative to a hypothetical localized carboxylate, which is the dominant reason the parent acid gives up its proton so much more readily — the resulting conjugate base is so much better stabilized by resonance.
Limiting case check: if the carboxylate's two oxygens were inequivalent by some substituent asymmetry (say, one oxygen forced out of conjugation by extreme steric twisting), the delocalization would be disrupted, the two C–O bonds would diverge in length, and the acidifying effect would shrink toward the alcohol limit — precisely what is observed in severely twisted, non-planar carboxylate derivatives where π overlap is sterically prevented.
Example 3 — Exam/competition level: ranking the extent of delocalization in p-nitroaniline versus aniline using bond-length and dipole evidence. p-Nitroaniline (4-nitroaniline) has an –NH₂ (electron-donating, lone pair conjugatable into the ring) at one end of the benzene ring and –NO₂ (electron-withdrawing, itself delocalized as in nitrate-like fashion over its own two oxygens and conjugatable with the ring) at the para position. The question: does resonance allow the nitrogen lone pair on the amine to communicate all the way to the oxygens of the nitro group, four bonds away, and if so, what evidence proves it? Building the full resonance chain: the nitrogen lone pair donates into the ring (forming an iminium-like C=N⁺H₂ at the ipso ring carbon and pushing a ring double bond around), the ring's alternating double bonds shift all the way around to the para carbon bearing the nitro group, and finally the ring's π bond at that carbon donates into the nitro group's N=O π, placing a formal negative charge on one nitro oxygen and neutralizing part of the developing positive charge that started on the amine nitrogen. Every step obeys the rules from the derivation above: no atom moves, only adjacent p orbitals hand off electron density, one contributor at a time, ending in a fully valid closed-shell Lewis structure with formal charges of +1 on N(amine) and –1 on one nitro oxygen — an internally charge-separated, "push–pull" resonance contributor. The diagnostic evidence: (1) the C–N(amine) bond in p*-nitroaniline is measurably shorter (≈1.36 Å) than a typical C(sp²)–N single bond (≈1.43 Å) — direct evidence of partial double-bond character from delocalization; (2) the C–N(nitro) bond is correspondingly shortened relative to nitrobenzene alone; (3) the compound's dipole moment (6.2 D) is substantially larger than the vector sum estimated by adding aniline's dipole (1.5 D) and nitrobenzene's dipole (4.0 D) independently ( 5.5 D vectorially in a simple additive model) — the extra ≈0.7 D reflects genuine charge transfer across the whole conjugated system through the push–pull resonance contributor, not merely two separate substituent dipoles sitting on an inert ring.
Limiting case check: in meta-nitroaniline, the –NH₂ and –NO₂ are not conjugated through a continuous alternating path connecting them directly (the meta relationship breaks the necessary alternation for a single unbroken chain of resonance structures linking donor to acceptor), so the anomalously large dipole enhancement and bond-length shortening seen in the para isomer largely disappear — confirming that the effect in the para case is a direct consequence of an unbroken delocalized path, not a generic ring effect.
Limiting cases, scope & common traps
| Situation | What resonance predicts | Why |
|---|---|---|
| Localized π bond, no adjacent lone pair/empty p orbital (e.g., simple alkene, ketone C=O) | Single dominant Lewis structure suffices | No 3rd atom offers an aligned p orbital to extend the π system |
| Lone pair adjacent to a π bond or empty p orbital, all p orbitals parallel (allylic, benzylic, carbonyl-adjacent, amide, carboxylate) | Multiple contributors needed; real bond lengths/charges intermediate | 3(+)-center delocalized π MO exists; no single 2c–2e picture captures it |
| Lone pair in an orbital orthogonal to the π system (e.g., an amine lone pair held perpendicular to a ring by geometric constraint) | No resonance donation possible despite adjacency | Overlap integral between orthogonal p orbitals is zero; symmetry forbids conjugation |
| Two structures of very different energy (e.g., one with all octets satisfied and no charge separation vs. one with charge separation on electronegative-mismatched atoms) | Lower-energy contributor dominates the hybrid; higher-energy one contributes little | Better contributors weight more heavily (full criteria under evaluating resonance structures) |
| Structures differing in atom connectivity or proton position | Not resonance at all — these are tautomers or isomers | Resonance forbids moving nuclei; only electron placement may change |
The chemist behind it
The modern language of resonance was principally shaped by Linus Pauling, who translated the emerging quantum mechanics of the 1920s and 1930s into a chemically usable framework: valence bond theory, in which a molecule's true wavefunction is written as a linear combination of wavefunctions for individual (localized) Lewis-like structures. Pauling's 1939 book The Nature of the Chemical Bond, synthesizing over a decade of his own papers (many with collaborators including George Wheland, who did much of the rigorous mathematical development of resonance energy calculations for aromatic systems), became the standard text through which generations of chemists learned to think about delocalization not as a competing rival theory to molecular orbital theory, but as a complementary bookkeeping device built on the same underlying quantum superposition principle: a wavefunction can, and generally must, be written as a weighted sum of basis functions when no single simple function suffices. Pauling arrived at the concept while reconciling early quantum chemical calculations on benzene (which showed its true energy to be substantially lower than any single Kekulé structure would predict) with the chemical need for a structure students and researchers could actually draw and use predictively. He coined much of the vocabulary still used today — resonance energy, resonance hybrid, resonance structure — deliberately choosing the word "resonance" as an analogy to coupled classical oscillators (two pendulums connected by a spring exchange energy and settle into normal modes lower in energy than either isolated pendulum), even though he was careful to stress, as this article has, that no literal oscillation between structures occurs in the molecule itself.
Origins · 1 minLinus Carl Pauling and how this was discovered
Is resonance a real physical phenomenon, or just a drawing trick?
It is real in the sense that delocalized electron density genuinely exists — spectroscopy and diffraction measure bond lengths and charges that only make sense as averages over multiple contributors. But the individual resonance structures themselves are not real, separable species; only the hybrid is real. Resonance is best understood as an approximation method (valence bond theory) for describing a genuinely delocalized quantum state using a superposition of simpler, individually unrealistic, localized pictures — analogous to how a circle can be approximated (never perfectly captured) by superposing many straight line segments. The delocalization is physical; the multiple-structures bookkeeping is a representational convenience.
How is resonance different from tautomerism, since both involve drawing multiple structures for "the same" compound?
Tautomers, like the keto and enol forms of acetone, are genuinely different molecules — different connectivity, different placement of a proton and a σ bond — that interconvert through an actual chemical reaction (breaking and forming real bonds, often proton transfer) and can, in principle, be present as a measurable equilibrium mixture with two distinct sets of physical properties. Resonance structures share identical connectivity and identical nuclear positions; only electrons are redrawn, and there is only one real species, not two. If you find yourself moving a hydrogen atom or breaking a σ bond between the "two structures," you have drawn tautomers or isomers, not resonance contributors, and equilibrium arrows (⇌) are appropriate instead of the resonance double arrow (↔).
Why does resonance always stabilize a molecule — can it ever destabilize one?
Delocalization can only lower a system's ground-state energy relative to the best possible single localized structure, a direct consequence of the variational principle in quantum mechanics: allowing the wavefunction more flexibility (more basis structures to mix) can only find an equal or lower minimum energy, never a higher one. This is why every legitimately resonance-stabilized species (carboxylates, amides, aromatic rings, allylic and benzylic cations/anions/radicals) is more stable than a hypothetical localized analog. What can happen is that steric or electronic constraints prevent full overlap (as in twisted amides or perpendicular lone pairs), in which case the stabilization is simply reduced or absent — never reversed into a penalty.
How many resonance structures should I draw for a given molecule — is there a rule for when to stop?
Draw contributors until you have accounted for every legal electron reorganization pathway available from the rules (adjacent aligned p orbitals, conserved connectivity, conserved total charge and electron count) that leads to a chemically valid structure, then stop — further "structures" that violate valence rules, break connectivity, or require non-adjacent long-range electron jumps are not legitimate and should be discarded. In practice for exam-level problems this is almost always 2–4 structures (2 for allylic/carboxylate-type systems, 3 for nitrate/carbonate-type systems, up to 5 for extended push-pull aromatic systems like p-nitroaniline). Once you've generated the legal set, ranking their relative importance is a separate skill, covered under evaluating resonance structures.
Do all lone pairs next to a π system participate in resonance, or only some?
Only lone pairs occupying a p orbital (or an orbital with substantial p character) aligned parallel to the adjacent π system participate; a lone pair in a pure sp³ orbital pointed away from, or perpendicular to, the π framework cannot overlap and does not delocalize, regardless of formal adjacency. This is exactly why, for example, the nitrogen lone pair in pyrrole (in a p orbital, part of the aromatic sextet) behaves completely differently from the nitrogen lone pair in pyridine (in an sp² orbital in the ring plane, orthogonal to the π system, fully available for protonation) — a distinction with enormous consequences for basicity and reactivity that traces directly back to orbital geometry, not just atom connectivity.
Why do resonance structures need to have the same net charge as each other?
Because they are meant to represent the same molecule — the same collection of nuclei and the same total number of electrons — differing only in how those electrons are distributed among bonds and lone pairs. Total charge is simply (sum of nuclear charges) minus (total number of electrons), both of which are fixed once you have specified the molecule or ion in question. If two proposed "resonance structures" have different net charges, they necessarily contain different numbers of electrons and therefore cannot be pictures of the same species — a reliable and fast check for catching drawing errors, especially when a lone pair or bonding pair is accidentally lost or gained during an electron-pushing step.
Can resonance structures have different numbers of unpaired electrons — for example, mixing a closed-shell structure with a diradical structure?
Yes, in specific and chemically important cases — the classic example is ortho- and para-quinodimethane-type systems, or more commonly, the description of the ground state of certain diradicaloid molecules and some transition-metal-free "no-bond resonance" situations, where a closed-shell (zwitterionic) contributor and an open-shell (diradical) contributor both contribute to the true electronic structure. This is more advanced than typical introductory treatment and is usually reserved for specialized topics (such as the electronic structure of ortho-benzyne or certain stable diradicals), but it follows the same underlying logic: whichever set of valid Lewis-type structures, open- or closed-shell, best spans the true multi-configurational wavefunction should be included, so long as total electron count and total charge remain conserved across every contributor.