Selling costs that reduce the gain typically include commission, legal fees and other direct costs of the sale, so the number that matters for tax purposes is your net gain after those costs, not the top-line sale price.
Capital improvements, a new roof or an addition, for example, can be added to your cost base, but routine repairs and maintenance generally cannot, which is why keeping receipts for permitted renovation work, and for legal fees typically $800 to $1,500, matters at tax time as well as at resale.
If the property was your principal residence for the entire period of ownership, this gain calculation usually does not translate into tax owed, but it is still worth understanding for record-keeping.
Get your hand-reviewed valuation from Joel Dyck.