Codex Madrid: The Lost Leonardo Notebooks Found by Accident

(Last updated: Sep 2026)

Madrid Codices
Folios 28v–29r from Leonardo da Vinci’s Codex Madrid I, featuring studies of applied mechanics and machine elements.

The Codex Madrid is one of the strangest survival stories in Renaissance history. Two working notebooks filled with Leonardo da Vinci's sketches, calculations, and private notes vanished from view for more than two centuries — and were only found again by accident, tucked away on a library shelf in Spain.

Long before museums treated his pages as priceless art, Leonardo treated them as a working journal. He used them to think on paper: testing gear ratios, sketching fortress walls, and jotting down which books he still needed to read.

That makes the Codex Madrid one of the clearest windows we have into how a Renaissance genius actually worked, day to day, rather than how history later chose to remember him. Seeing these pages in person — even just knowing they survive at all — adds a layer of intimacy that no reproduction or textbook photo can fully capture.

This post is all about Codex Madrid: what's inside it, why it disappeared, how it resurfaced, and where you can see it for yourself today.

The Genius Behind the Codex Madrid

To understand why the Codex Madrid matters, it helps to know how Leonardo actually filled these pages — and what made his handwriting so unusual in the first place.

Leonardo's Working Notebooks and Mirror Writing

Leonardo da Vinci filled dozens of notebooks over his lifetime, and the Codex Madrid is part of that same sprawling habit. He wasn't writing for an audience. He was writing for himself, which is exactly what makes Leonardo da Vinci notebooks so fascinating to read today.

Ideas jump from one subject to another mid-page. A study of a pulley system sits next to a shopping list. A diagram of a screw mechanism sits beside a stray thought about light and shadow.

Most of the text is also written in Leonardo's mirror writing, running from right to left across the page. Leonardo was left-handed, and writing this way kept his hand from smudging wet ink as it moved across the paper.

It wasn't a secret code, despite the myth — just a practical habit that happened to make his da Vinci notes look cryptic to anyone who picked them up centuries later.

What makes the Codex Madrid especially valuable to historians is its unfiltered nature. Leonardo never edited these pages for an audience, so the tone shifts constantly.

A careful geometric proof might sit above a hurried sketch of a lifting device, followed a few lines later by a personal reminder about money owed or a book to borrow. Reading through it feels less like studying a finished treatise and more like flipping through a Leonardo da Vinci journal that was never meant to leave his workshop.

Codex Madrid I – A Treatise on Mechanics

The first volume, Codex Madrid I, was composed between 1490 and 1499 and runs to nearly 200 pages. It is largely a treatise on statics and mechanics, filled with meticulously finished drawings of gears, screws, springs, and load-bearing structures. Some of these Leonardo drawings are so precise they read almost like modern engineering diagrams rather than 500-year-old sketches.

Scholars have long noted how closely this manuscript relates to the Codex Atlanticus, the enormous collection of Leonardo's papers held in Milan, since both explore overlapping mechanical problems from slightly different angles.

Together, they show an inventor circling the same questions from multiple directions until the mechanism finally clicked into place.

Codex Madrid II – Fortification, Geometry, and a Bronze Horse

The second volume, Codex Madrid II, was written slightly later, between 1503 and 1505, and takes a different path. Its pages move through military fortification, geometry, hydraulics, and topographical studies — practical knowledge Leonardo needed while working as a military engineer for powerful patrons in Florence and Milan.

One section stands out from the rest: detailed notes on casting a monumental bronze horse, tied to Leonardo's long-running project for an equestrian monument in Milan. The statue itself was never completed in bronze, but the engineering notes survive here in astonishing technical detail, giving a rare glimpse of Leonardo the metallurgist and problem-solver rather than Leonardo the painter.

Quick context: The Codex Madrid sits alongside other major surviving collections of Leonardo's writing, including the Codex Atlanticus in Milan, the Codex Arundel and Codex Forster in London, and the Codex Leicester, now privately owned. Each one covers a different slice of Leonardo's restless curiosity — together they form the closest thing we have to his complete Leonardo da Vinci diary.

Why the Codex Madrid Became Famous

Codex Madrid

A brilliant notebook is only half the story. What turned the Codex Madrid into international news wasn't just what was inside it — it was how completely it vanished, and how strangely it came back.

From the Royal Library to a Cataloging Mistake

After Leonardo's death in 1519, his notebooks passed to his student and heir, Francesco Melzi. Decades later, Melzi's son sold a large batch of Leonardo's papers to the sculptor Pompeo Leoni, who was working at the Spanish royal court under Philip II. That sale is how these particular pages ended up crossing from Italy into Spain in the first place.

From there, the manuscripts moved between royal and monastic collections for over a century before finally entering Spain's Royal Library in 1712. Somewhere along the way, a cataloging error buried their true identity. The two volumes were misfiled under the wrong shelf numbers, and the connection to Leonardo simply disappeared from the record. For the next 150-plus years, anyone browsing the library's official catalog would have had no idea two Leonardo da Vinci codex manuscripts were sitting quietly in the stacks.

The Accidental Discovery of 1967

The rediscovery happened almost by chance. In February 1967, Jules Piccus, an American professor of Romance languages at the University of Massachusetts, was searching the Biblioteca Nacional de España for medieval songbooks — a completely unrelated research project. While working through the library's older, poorly labeled holdings, he came across two volumes that didn't match their catalog description at all.

What he'd actually found were the missing Madrid Codices, which were soon after confirmed as genuine, unpublished Leonardo da Vinci writings. The announcement on February 13, 1967 made international headlines, since finding any new Leonardo material at all is exceedingly rare — let alone two full Leonardo notebooks totaling several hundred pages.

A Second Renaissance in Leonardo Studies

The rediscovery reshaped Leonardo scholarship almost overnight. Historians suddenly had access to hundreds of new pages of diagrams, calculations, and marginal notes that had never been studied before.

Engineers and historians of science pored over the mechanical drawings in Codex Madrid I in particular, since so many of the mechanisms sketched there anticipated devices that wouldn't reappear in engineering texts for centuries.

Today, the Codex Madrid stands as one of only two verified Leonardo works held anywhere in Spain, and it remains a touchstone for anyone studying Leonardo codex material — proof that even 500 years on, Leonardo's archive still has secrets left to give up.

Where to See the Codex Madrid Today

Both volumes remain at the same institution where they were rediscovered, and visiting Madrid puts you within walking distance of one of the rarest collections of Leonardo's work on earth.

Inside the Biblioteca Nacional de España

The Biblioteca Nacional de España, Spain's national library on Paseo de Recoletos, holds both codices in its historical manuscripts collection. Because these are fragile 500-year-old documents, the original pages aren't kept on permanent public display as a painting might hang in a gallery — access to the physical originals is reserved for accredited researchers, and the library periodically features select pages in temporary exhibitions.

Even without seeing the originals under glass, walking through the library's grand reading rooms and adjoining Museo Arqueológico Nacional building gives a real sense of the institution that quietly guarded these pages for centuries — and for travelers who want that context explained on the ground, a guided walking tour through Leonardo's Madrid, weaving together the library, the city's Renaissance-era architecture, and the story of the codices, tends to make the history click in a way that reading about it alone doesn't.

Browsing the Manuscripts Online

For anyone who can't make it to Madrid, the Biblioteca Nacional de España digitized both codices in 2012, and the full page-by-page scans are freely available to browse through the library's online portal.

It's a striking way to explore Leonardo's mirror writing and diagrams up close, page by page, from anywhere in the world — a modern echo of the same notebooks a Renaissance polymath once carried around with him.

The digitized pages also make it easier to compare the Codex Madrid against Leonardo's other surviving manuscripts. Researchers routinely cross-reference details here with the Codex Atlanticus in Milan, the Codex Forster volumes, and the Codex Arundel in London, since the same mechanical ideas often reappear in slightly different forms across several notebooks.

Seeing that overlap firsthand is one of the clearest ways to understand how Leonardo actually developed an idea — not in a single flash of insight, but through years of returning to the same problem from new angles.

Experiencing Leonardo's Madrid Codices in Person

Reading about the Codex Madrid is one thing. Standing in the same city that hid these pages for 150 years, in the same library where a professor stumbled onto them by accident, is another.

Madrid wears its Leonardo connection quietly — there's no dedicated Leonardo museum here, as there is in Milan or Florence — but that quietness is part of what makes the discovery story land. This wasn't a masterpiece kept safe in a vault; it was a filing mistake that took over a century and a half to notice.

Visitors who build in time at the Biblioteca Nacional de España and pair it with a guide who can explain what's actually inside the codices tend to come away with a much sharper sense of Leonardo as a working engineer rather than just a painter.

Many visitors find that having the mechanical drawings and the fortification sketches explained on-site — rather than skimmed later online — is what makes the collection feel real.

Codex Forster

Walk Through Leonardo’s Madrid

Discover Leonardo’s Madrid on a guided walk tracing the remarkable story, rediscovery, and legacy of his lost codices

Explore Leonardo’s Madrid

Leonardo da Vinci's Madrid: Guided Walking Experience

A guided walk connecting the Biblioteca Nacional de España to the broader story of how Leonardo's lost notebooks resurfaced in Spain.

  • Small-group walking route through central Madrid
  • Context on the Codex Madrid I and II and their 1967 rediscovery
  • Stops near the library, Plaza de Colón, and Renaissance-era Madrid

Travelers researching Leonardo's manuscripts often add this as a low-key, informational way to ground the history in a real place rather than a screen. Check availability

If you're planning a Madrid itinerary that already includes the Prado or the Reina Sofía, this kind of guided context is easy to slot in as a half-day addition — a quieter, more research-driven counterpart to the city's better-known art museums.

Exploring Leonardo da Vinci in Madrid

Madrid is an unusual stop on any Leonardo trail. Most travelers chasing his legacy head straight to Milan, where he painted The Last Supper and worked for the Sforza court, or Florence, where he trained and first made his name.

Madrid doesn't have that kind of visible Leonardo footprint — no fresco, no famous painting hanging in a Spanish gallery. What it has instead is a paper trail: the Codex Madrid and the strange 450-year journey that brought two of his private notebooks here, then buried them for a century and a half.

That makes Madrid a natural addition to a wider Leonardo itinerary rather than a starting point. Pair it with Venice, where Leonardo briefly worked as a military engineer, Rome, where he spent his later Italian years under papal patronage, and Paris, home to the Mona Lisa and the château where he died. Seen together, these cities trace the full arc of Leonardo's life — and Madrid quietly fills in one of its most surprising chapters.

Final Thoughts

This post was all about Codex Madrid — two working notebooks that captured Leonardo da Vinci's mind at its most restless, then disappeared for over 150 years through nothing more dramatic than a filing error. That gap between genius and accident is what makes the story stick.

Leonardo wasn't writing for future scholars when he sketched gear systems and fortress walls in mirror writing; he was just thinking out loud on paper, the way any curious mind does.

The Renaissance gave the world plenty of finished masterpieces, but the Codex Madrid offers something rarer: an unfiltered look at the process behind them. Seeing that story unfold in the very city where it was lost and found again is, for many travelers, exactly what turns a history lesson into a memory worth keeping.

Related Post You May Like

Disclosure: This page may contain affiliate links. If you book through them, we may earn a small commission at no extra cost to you. Learn more.

Free Leonardo Milan Travel Guide

Plan Your Leonardo Trip in Milan

A premium mini guidebook for smarter Milan planning, including the best ticket strategy, Leonardo map, and practical visitor advice.

Get the Free Guide

Download the guide and receive practical Milan planning tips by email.

Download the Free Guide >>