Export CSV Files From Interactive Brokers
- Open Interactive Brokers and go to Portfolio.
- Go to Performance & Reports, then Statements.
- Select Realized Summary.
- Set Period to Custom Date Range.
- Choose a range that covers your account history, not only the year you are reporting.
- Download the statement as CSV.
Which Files To Upload
Upload one or more IBKR Realized Summary CSV exports. Multiple files are combined before calculation.
For UK Capital Gains Tax, include reports from previous tax years where possible, ideally from account inception. Also include at least 30 days after the tax year ends. This is needed for Section 104 pooling, the 30-day matching rule, and positions that span tax years.
Uploading only a single tax-year statement can produce incorrect results when earlier holdings or later matching purchases are relevant.
Calculation Approach
The calculator applies UK share matching rules in order: same-day matching, acquisitions within 30 days after a disposal, then the Section 104 pool. It supports shares, listed options, long and short positions, commissions and fees, and stock split corporate actions found in the IBKR export.
Trades in USD are converted to GBP using bundled daily Bank of England exchange-rate files. The tax-year selector is limited to years covered by those bundled FX files.
The output provides the figures used for the Self Assessment Capital Gains Tax return: total disposal proceeds, allowable costs, gains, losses, fees, and number of disposals. The downloadable report also includes per-asset detail so the matching can be reviewed.
Why Use This Calculator
The project is open source and the report shows the calculation breakdown rather than only final totals. Your IBKR account does not need to be denominated in sterling: supported foreign-currency trades are converted automatically using the bundled FX data.
Privacy
The GitHub Pages app is static. CSV files are read in your browser and calculations run locally through Pyodide in a Web Worker. The app does not need a backend service to process uploads.
Disclaimer
This tool is intended to assist with UK Capital Gains Tax calculations. You are responsible for reviewing the output and submitting accurate figures to HMRC.
If you find an issue with the calculation or CSV handling, report it on GitHub Issues with enough detail to reproduce it.