How numerous were dragons in the time before The Lord of the Rings and The Hobbit? How many dragons did Tolkien ever mention by name?
As usual, Tolkien Gateway has the best compilation of info:
There were 4 named ones:
- Glaurung — Father of Dragons, slain by Túrin Turambar. First of the Uruloki, the Fire-drakes of Angband. He had four legs and could breathe fire, but didn't have wings.
- Ancalagon the Black — first and mightiest of the Winged-dragons, slain by Eärendil in the War of Wrath.
- Scatha - Slain by Fram of the Éothéod. Apparently a cold-drake. Described as a "long-worm", although this imprecise term seems to be more of an expression rather than a separate taxonomic group.
- Smaug — the last great dragon (but possibly not the last dragon based on Gandalf's words) of Middle-earth. A winged Urulokë.
2 more were mentioned but unnamed
- An unnamed dragon, with red eyes, black wings and teeth like knives. (src: The Adventures of Tom Bombadil, "The Hoard")
- Beast of Gondolin — A Fire-Drake at the Fall of Gondolin.
Total numbers aren't given but there were many:
At the Fall of Gondolin, Morgoth's foul host included dragons, "many and terrible" (src: The Silmarillion, "Quenta Silmarillion: Of Tuor and the Fall of Gondolin")
Dragons were "created" by Melkor/Morgoth during the early part of the First Age of the Sun, and for a long time the only dragon mentioned by name was Glaurung, the father of dragons. We may assume that more dragons were being bred in the Pits of Angband during this time.
The first occurrance of more than one dragon was at the Battle of Unnumbered Tears, where we read:
Morgoth loosed his last strength, and Angband was emptied. There came wolves, and wolfriders, and there came Balrogs, and dragons, and Glaurung father of dragons. (Silmarillion)
Following this battle, and until the Fall of Gondolin, Glaurung is again the only dragon mentioned as being active in Middle-earth, but at the Fall of Gondolin they come out again (Glaurung had been killed by Turin by this time):
At last, in the year when Earendil was seven years old, Morgoth was ready, and he loosed upon Gondolin his Balrogs, and his Orcs, and his wolves; and with them came dragons of the brood of Glaurung, and they were become now many and terrible. (Silmarillion)
Finally, at the War of Wrath, we see the first appearance of the winged dragons:
But he loosed upon his foes the last desperate assault that he had prepared, and out of the pits of Angband there issued the winged dragons, that had not before been seen... (Silmarillion)
During the War of Wrath most dragons were killed (including Ancalagon); some variants of the texts note that two escaped, but the Silmarillion itself is not specific about the number:
Then the sun rose, and the host of the Valar prevailed, and well-nigh all the dragons were destroyed...
Dragons were entirely inactive during the Second Age, and only reappeared after a good part of the Third Age had passed, as the Tale of Years (LotR Appendix B) notes:
The Dwarves hid themselves in deep places, guarding their hoards; but when evil began to stir again and dragons reappeared, one by one their ancient treasures were plundered...
2570. Baldor son of Brego enters the Forbidden Door and is lost. About this time Dragons reappear in the far North and begin to afflict the Dwarves.
At no stage is the actual precise number of dragons given.
The most famous dragon in Middle-earth is, of course, the Green one in Bywater.
The LOTR wiki identifies 7 dragons by name (as well as a host of other dragons described but not named)
Glaurung - Slain by Túrin Turambar, also known as the father of Dragons.
Ancalagon the Black - Slain by Eärendil, the mightiest Winged Dragon to have ever lived.
Scatha the Worm - Slain by Fram, the hoard Scatha guarded was taken from the Dwarves, thus Fram taking it led to arguments and his eventual death at the hands of the Dwarves.
The Great Cold Drake - A cold drake of great power which attacked Dwarves of Grey Mountains and killed Dáin I and his second son Frór.
Smaug - Slain with the Black Arrow by Bard the Bowman, afterward King Bard, of Dale.
[The] Fire-drake of Gondolin - The beast defeated (not killed) by Tuor, who stabbed it in the foot.
Gostir - a name-only known individual
The Silmarillion also identifies that in the "War of Wrath", Ancalagon commanded a "Dragon-host" (e.g. a sizeable number of other dragons). There's no specific numbers but we're left to infer that it was a substantial armada since their destruction effectively ended the reign of dragons on Middle Earth.
Before the rising of the sun Eärendil slew Ancalagon the Black, the mightiest of the dragon-host, and cast him from the sky; and he fell upon the towers of Thangorodrim, and they were broken in his ruin.
There's also a handy (but completely non-canon) size-chart :-)
There is no canon reference for the total number of dragons.
Dragons referenced by name:
Ancalagon the Black
Fire-drake of Gondolin
Glaurung, the first dragon bred by Morgoth, know as the father of dragons, though it is unclear if he is literally the ancestor of all dragons. He was killed by Túrin Turambar.
Smaug - from the Hobbit
Scatha the Worm - took a Dwarven hoard (like Smaug)
The Great Cold Drake - attacked the Dwaves of the Grey Mountains and killed Dáin
It's also of worth noting that dragons first appeared in FA 260 and continued to exist at the time of Lord of the Rings. When discussing destorying the Ring, Gandalf said "there is not now any dragon left on earth in which the old fire is hot enough", implying that some dragons still existed.