From the RAW:
A wizard can also add a spell to her book whenever she encounters one
on a magic scroll or in another wizard's spellbook.
In most cases, wizards charge a fee for the privilege of copying spells
from their spellbooks. This fee is usually equal to the spell's level x 50 gp.
A spell takes up one page of the spellbook per spell level. Even a 0-level
spell (cantrip) takes one page. Materials for writing the spell cost
100 gp per page.
Spell Lvl Cost to Scribe (including source)
1 125
2 300
3 450
4 600
5 750
6 900
7 1050
8 1200
9 1350
LVL NPC Starting Wealth Book Cost 9th 8th 7th 6th 5th 4th 3rd 2nd 1st
1st: 900 250 2
2nd: 2000 625 5
3rd: 2500 625 0 5
4th: 3300 925 1 5
5th: 4300 1225 2 5
6th: 5600 1675 1 2 5
7th: 7200 2125 2 2 5
8th: 9400 3025 1 2 3 5
9th: 12000 3925 2 2 4 5
10th: 16000 5125 1 2 3 4 5
11th: 21000 6775 1 2 2 3 4 5
12th: 27000 8725 2 2 3 4 4 5
13th: 35000 11125 1 2 3 4 4 4 5
14th: 45000 15000 3 3 4 4 4 4 6
15th: 59000 19650 2 3 4 4 5 5 5 6
16th: 77000 25650 3 4 5 6 6 6 6 6
17th: 100000 33300 4 4 5 5 6 6 6 6 6
18th: 130000 43125 6 6 6 6 7 7 7 8 9
19th: 170000 56450 8 8 8 8 9 9 9 10 10
20th: 220000 73050 10 11 11 11 11 11 11 12 12
Lvl 9th 8th 7th 6th 5th 4th 3rd 2nd 1st
1st: 5
2nd: 10
3rd: 2 10
4th: 5 10
5th: 2 6 10
6th: 5 6 10
7th: 2 6 6 10
8th: 5 6 7 10
9th: 2 6 6 8 10
10th: 5 6 7 8 10
11th: 3 6 6 7 8 10
12th: 6 6 7 8 8 10
13th: 3 6 7 8 8 8 10
14th: 7 7 8 8 8 8 11
15th: 4 7 8 8 9 9 9 11
16th: 7 8 9 10 10 10 10 11
17th: 6 8 9 9 10 10 10 10 11
18th: 10 10 10 10 11 11 11 12 14
19th: 12 12 12 12 13 13 13 14 15
20th: 14 15 15 15 15 15 15 16 17
Old Drew Id said:I crunched the math on this, based on NPC starting wealth and the cost to scribe spells into the spellbook, and this is what I came up with:
SUMMARY:
This is an interesting result, and not really what I would have expected. A mid- to high-level NPC has about 1/3 of the wealth of a PC, and can only spend 1/3 of their wealth on their spellbook, but even with that limitation, they can still have an extremely full and varied spellbook.
Old Drew Id said:NOTE #5: A spell book is said to contain only 100 pages, so the wizard would finally need a second book at level 18 (109 pages.)
Patryn of Elvenshae said:They'd need one a lot sooner than that; each spell takes up [Spell Level] pages.
Yoink, stolen. This is great! Thank you.Old Drew Id said:I crunched the math on this, based on NPC starting wealth and the cost to scribe spells into the spellbook, and this is what I came up with:
Patryn of Elvenshae said:They'd need one a lot sooner than that; each spell takes up [Spell Level] pages.

(Dungeons & Dragons)
Rulebook featuring "high magic" options, including a host of new spells.