Fair value of financial instruments - Additional Information (Detail) - CAD ($) $ in Millions |
3 Months Ended | 6 Months Ended | ||
|---|---|---|---|---|
Apr. 30, 2026 |
Apr. 30, 2025 |
Apr. 30, 2026 |
Apr. 30, 2025 |
|
| Disclosure of fair value measurement of assets and liabilities [line Items] | ||||
| Transfers out of Level 2 to Level 1 | $ 0 | $ 0 | $ 0 | $ 0 |
| Transfers out of Level 2 to Level 3 | 0 | 0 | ||
| Investment U.S. federal, state, municipal and agencies [member] | ||||
| Disclosure of fair value measurement of assets and liabilities [line Items] | ||||
| Transfers out of Level 1 to Level 2 | 303 | 439 | ||
| Trading U.S. federal, state, municipal and agencies debt [Member] | ||||
| Disclosure of fair value measurement of assets and liabilities [line Items] | ||||
| Transfers out of Level 1 to Level 2 | $ 483 | $ 938 | $ 483 | $ 938 |