Ada Lovelace invented the first computer program. Between 1842 and 1843, she translated an Italian military engineer’s memoir on Charles Babbage’s Analytical Engine and appended seven notes that were longer than the original text. Note G contains a step-by-step algorithm for computing Bernoulli numbers on the Engine, complete with a table of operations, variable assignments, and a loop-like repetition structure. That makes it the earliest published program intended for a general-purpose mechanical computer, even though the machine it targeted was never completed.

The Mechanism: What the Program Actually Did

The Analytical Engine was designed as a programmable, general-purpose mechanical computer. It separated three functions that earlier calculators merged: a “store” for numbers, a “mill” for arithmetic, and a set of punched cards that controlled the sequence of operations. Babbage borrowed the card idea from the Jacquard loom, which used punched cards to select which threads a loom raised. In the Engine, a card told the machine which operation to run and where to read and write values.

Lovelace’s Note G exploited that architecture. The goal was to compute Bernoulli numbers, a sequence that appears in the series expansions of trigonometric and exponential functions. She chose them deliberately: they are awkward to compute by hand because the recurrence relation is circular. Each Bernoulli number depends on all the earlier ones, so a calculator that only performs a fixed sequence of additions and multiplications cannot produce them efficiently. The Engine could, because it could branch and repeat.

Her “diagram of operations” is the part that earns the title of program. It assigns working variables (V1 through V7 in her notation), specifies the arithmetic operation for each step, and states which card supplies the next instruction. The structure includes a repeated cycle of operations under one set of cards, with the operation cards advanced and the variable cards rewound. That is a loop, expressed in mechanical terms roughly a century before electronic computers had one.

The deeper point is why the cards matter. A calculator computes one fixed function when you turn a crank. A programmable machine reads its behavior from an external description, so the same hardware can compute different things. Lovelace’s contribution was not just arithmetic; it was the idea that the sequence of operations could encode a general method. Put plainly: she wrote instructions for a machine that would follow a written recipe rather than perform a single trick.

Quantified Context: Scale, Dates, and Arithmetic Ambition

The numbers behind the claim are concrete. Lovelace’s translation and notes were published in 1843 in Taylor’s Scientific Memoirs. The notes run roughly two and a half times the length of the translated memoir, with Note G alone spanning several printed pages of operation tables. The Analytical Engine she described was specified to hold 1,000 numbers of 40 decimal digits each in its store, with the “mill” able to handle numbers of that size.

The Bernoulli computation she chose was not a toy. The recurrence relation for Bernoulli numbers grows quickly: computing even the first several terms by direct hand methods requires tracking many intermediate products. Her operation table for the program lists on the order of two dozen distinct steps for the initial part of the calculation, and the loop then repeats for each successive number. That is the kind of bookkeeping burden a machine relieves.

For scale, consider the timing. Babbage first described the Analytical Engine in 1837. Lovelace’s notes appeared in 1843. The first working programmable electronic computers arrived in the 1940s, roughly a century later. The Engine itself was never finished; only fragments and test assemblies were built. So the program was correct in principle but never executed on the intended hardware. It exists as a paper artifact, verified by later historians who reconstructed the calculation.

Edge Cases: What Counts as “First”

The “first program” claim has boundary conditions worth stating. Babbage himself wrote fragmentary sequences of operations for the Engine, and some historians credit him with earlier program-like notations. His notes on the Difference Engine also contain tabular procedures. The distinction that favors Lovelace is publication and completeness: Note G is a full, documented algorithm with a step table, written for a general-purpose machine, and published under her name with her own framing.

Another edge case is definition. If “program” means any fixed set of instructions for a special-purpose device, earlier automata and looms qualify. Jacquard looms were programmable in a limited sense from around 1804. If “program” means an algorithm for a general-purpose computer, Lovelace’s note is the earliest well-documented candidate.

The practical caveat is translation. Her program was written for a machine with decimal, not binary, arithmetic and with mechanical carry propagation. A modern reader cannot run it on a conventional computer without reimplementing the Engine’s instruction set. That does not weaken the claim; it clarifies that the program is architecture-specific, as all programs are.

The Engine was never completed, so the program was never run on its target hardware. Babbage wrote partial operation sequences earlier; Lovelace’s is the first published complete one. “First” depends on whether you count special-purpose looms and automata. The program assumes decimal arithmetic and mechanical storage, not binary electronics.

Misconceptions: Ada Didn’t Just Translate

The most common misconception is that Lovelace merely translated Menabrea’s memoir. The translation was the smaller part. Her notes introduce the concept of the machine operating on symbols as well as numbers, and she speculated that such a machine could compose music if the relationships between pitched sounds were expressible algebraically. That speculation is often quoted as foresight; it is better read as an argument about generality.

A second misconception credits her with inventing the computer. She did not design the hardware; Babbage did. Her contribution was the method and the framing: the idea that a general-purpose machine is programmed by an external sequence, and that the sequence can encode any process expressible in operations.

A third misconception says the program was trivial arithmetic. The Bernoulli recurrence requires negative numbers, intermediate storage, and reuse of prior results. That is exactly the workload a stored-program machine handles well, and it is why she picked it.

The professional caveat is attribution. Historians debate how much of Note G’s operation table reflects Lovelace’s independent work versus collaboration with Babbage. The published record is hers, and the framing is hers, but the boundary is not perfectly clean. State the claim precisely: she published the first complete program for a general-purpose computer.

Comparison: Lovelace’s Program Against Alternatives

Candidate Date Target machine Complete algorithm Published
Jacquard loom card patterns c. 1804 Loom No, pattern only Yes
Babbage operation fragments 1830s Analytical Engine Partial Mostly unpublished
Lovelace Note G 1843 Analytical Engine Yes Yes
ENIAC setup programs 1940s ENIAC Yes Later accounts
Stored-program code late 1940s EDVAC-style machines Yes Yes

The table shows why Note G holds the title. It is the earliest row that is simultaneously complete, published, and aimed at a general-purpose machine. Later rows are complete but come a century later.

Timeline: From Design to Recognized First

Year Event
1837 Babbage describes the Analytical Engine
1804 Jacquard loom demonstrates punched-card control
1842 Menabrea publishes the Italian memoir
1843 Lovelace publishes translation and notes, including Note G
1871 Babbage dies; Engine unfinished
1937 Turing describes a universal machine, formalizing programmability
1940s First working programmable electronic computers
1953 Lovelace’s notes reprinted and reassessed by historians

The timeline makes the gap visible. The program predates the hardware by a century and the formal theory of computation by nearly a century.

Practical Actions: How to Verify and Teach the Claim

If you want to check the claim yourself, work from primary and near-primary sources. Read Note G in the 1843 Taylor’s Scientific Memoirs printing, then compare it to a modern description of the Bernoulli recurrence. You will see the same operations in a different notation.

To teach it, separate three ideas. First, the machine: store, mill, cards. Second, the method: a recurrence that needs prior results. Third, the encoding: a table mapping steps to operations and variables. That separation is what makes the program legible to a non-specialist.

For a concrete exercise, write out the first few Bernoulli numbers by the recurrence, then mark which steps would need a loop. You will hit the same wall Lovelace did: hand computation becomes impractical quickly, which is the argument for a machine.

Thresholds to reconcile: “first” means first published complete program for a general-purpose machine, not first instruction sequence of any kind. “Program” means an external, ordered description of operations, not a physical configuration. “General-purpose” means the hardware can be redirected by changing the description, not rebuilt.

Limitations: What the Record Does Not Settle

The historical record does not establish exactly how much of Note G’s operation table was drafted by Lovelace alone. Babbage’s correspondence shows collaboration, and the boundary between translation, annotation, and original composition is not documented in detail. The claim that survives scrutiny is the published, complete, general-purpose program.

The second limitation is hardware. Because the Engine was never finished, no one can say the program would have run without mechanical faults. Later reconstructions suggest the logic is sound, but reconstruction is not execution on original hardware.

The third limitation is definitional drift. “Computer,” “program,” and “general-purpose” all shifted meaning after 1945. Applying modern categories to 1843 artifacts is useful but anachronistic, and careful writers flag that.

For medical, legal, financial, safety, or similarly high-stakes decisions, this article is general educational information only. It is not a diagnosis, treatment plan, legal opinion, or investment recommendation, and it promises no outcomes. Consult a qualified local professional for advice specific to your situation; for immediate danger or self-harm risk, contact local emergency or crisis services.