AZ38
Level 1

Is capital gain/loss calculated across multiple accounts and investments?

For example, if I have an investment account with Fidelity where I gained $2,500 from selling one stock and lost $2,000 from selling another stock, and at the same time, I have a Coinbase account holding crypto where I sold one crypto at a loss of $1,000 and another crypto for a gain of $2,500, how is everything calculated? How does the $3,000 capital loss deduction interact with this scenario?