cgt-calc/capital-gains-calculator
关于
根据券商导出数据计算英国资本利得税,用于向 HMRC 提交 Self Assessment 纳税申报
其他项目实测星标增长
- 24小时
- +1
- 7天
- +1
- 15天
- +1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文
UK Capital Gains Calculator
Use cgt-calc to calculate UK capital gains from your investment transaction history and generate a detailed report from a supported broker export.
Supported sources are Charles Schwab, Freetrade, Hargreaves Lansdown, Interactive Brokers, Morgan Stanley, Revolut, Sharesight, Trading 212, Vanguard and a custom RAW format. Check your broker's guide before starting, especially for employer shares, because not every award export or transaction type is supported.
See the full documentation for installation, broker export guides, offshore funds (ERI), extra data and options, and Docker.
🚀 Quick Start
Install with uv and generate a report for
a tax year. --python 3.12 makes uv use Python 3.12, which it downloads if needed. Without it, uv
may use an older Python it finds and install an old release of cgt-calc without an error. pipx and
pip also work, but need Python 3.12 or newer.
uv tool install --python 3.12 cgt-calc
cgt-calc --year 2025 schwab_transactions.csv
Pass your broker's export, or the folder of exports: cgt-calc recognises the broker from each file's
contents. The broker options, such as --schwab-file, still work. See
Installation, Brokers, and
Generate a report for the complete steps.
What cgt-calc calculates
For supported transactions, cgt-calc calculates capital gains in GBP using the UK same-day, 30-day ("bed and breakfast") and Section 104 holding rules. The terminal summary and detailed PDF report show Disposal proceeds (sale amounts or values for other disposals), Allowable costs (costs deducted when calculating gains), gains, losses, dividends and interest. See Generate a report for how to create and check them.
For supported tax years, cgt-calc also provides tax estimates, which use your income if you give it. cgt-calc covers only the transactions you supply, does not work out your final tax bill and does not submit a return. Check your broker's limitations and the offshore funds limitations before relying on the result.
📊 Example Report
This compact 2025/26 example shows foreign-currency transactions, how sales are matched with shares acquired at different times, gains and losses, a dividend with overseas tax, and cash interest.
🤝 Contributing
Contributions are welcome! If you find a bug, have feature ideas, or want to add support for more brokers, please open an issue or pull request. See the development guide.
Found cgt-calc useful? A star on GitHub is a quick way to say thank you, and it also helps other people find it.
⚠️ Disclaimer
This tool is a calculation aid, not tax advice. It calculates capital gains figures from the transaction history you provide and is designed to apply the UK tax rules it supports, following the legislation and published HMRC guidance. Its authors and contributors are not acting as your tax advisers, the results may contain errors, and tax rules change.
You are responsible for providing complete data and checking the figures against your records and current HMRC guidance before using them in a tax return. For unusual or uncertain circumstances, consider consulting a suitably qualified tax adviser. The software is provided "as is", without warranty of any kind; see the MIT License. The PDF report's Noto Sans fonts ship with cgt-calc under the SIL Open Font License. HMRC's reporting fund dates ship under the Open Government Licence v3.0, and its exchange rates for April 2002 to April 2016 under the Open Government Licence v2.0 and v3.0, as their notice sets out.
探索相关项目
加载中…