Rp2
Privacy-focused, free, open-source cryptocurrency tax calculator for multiple countries: it handles multiple coins/exchanges and computes long/short-term capital gains, cost bases, in/out lot relationships/fractioning, and account balances. It supports FIFO, LIFO, HIFO and it outputs in form 8949 format. It has a programmable plugin architecture
Install / Use
/learn @eprbell/Rp2README

RP2 v1.7.2
Privacy-focused, free, powerful crypto tax calculator
IMPORTANT NOTICE FOR USA TAXPAYERS: Starting in 2025, the USA has transitioned from Universal Application to Per-Wallet Application. Support for Per-Wallet Application in RP2 is still under development — see issue #135. Do not use RP2 for 2025 (and later) USA tax reporting until this issue is fully resolved.
IMPORTANT NOTICE FOR TAXPAYERS WORLDWIDE: Support for Per-Wallet Application in RP2 is still in development - see issue 135 for details. If your country mandates Per-Wallet Application, do not use RP2 for tax reporting until that issue is resolved. If your country permits Universal Application (already supported by RP2), you may safely use RP2.
<!-- markdown-link-check-disable --> <!-- markdown-link-check-enable -->Table of Contents
- Introduction
- License
- Download
- Installation
- Running
- Input and Output Files
- Supported Countries and Accounting Methods
- RP2 Ecosystem
- Reporting Bugs
- Contributing
- Developer Documentation
- Frequently Asked Questions
- Change Log
Introduction
RP2 is a privacy-focused, free, non-commercial, open-source, community-driven cryptocurrency tax calculator for multiple countries. Preparing crypto taxes can be a daunting and error-prone task, especially if multiple transactions, coins, exchanges and wallets are involved. This task could be delegated to a crypto tax preparation service, but many crypto users value their privacy and prefer not to send their transaction information to third parties unnecessarily. Additionally, many of these services cost money. RP2 solves all of these problems:
- it manages the complexity related to coin flows and tax calculation and it generates reports that accountants can understand (in the format of form 8949, for the US case), even if they are not cryptocurrency experts;
- it prioritizes user privacy by storing crypto transactions and tax results on the user's computer and not sending them anywhere else;
- it's 100% free, open-source and non-commercial.
This means that with RP2 there are no transaction limits, no premium versions, no payment requests, no personal data sent to a server (at risk of being hacked), no account creation, no unauditable source code.
Another unique advantage of RP2 is transparent computation: RP2 generates full computation details for every lot fraction, so that it's possible to:
- verify step-by-step how RP2 reaches the final result;
- track down every lot fraction and its accounting details, in case of an audit.
RP2 supports most countries and various accounting methods, which vary country by country.
RP2 reads a configuration file and an input spreadsheet containing crypto transactions. These input files can be generated either manually or automatically using DaLI, a RP2 data loader and input generator (which is also privacy-focused, free, non-commercial, open-source and community-driven). After parsing the input, RP2 uses high-precision math to calculate long/short term capital gains, cost bases, balances, average price, in/out lot relationships/fractions, and finally it generates output files.
RP2 has a programmable plugin architecture for output generators, accounting methods and countries. Built-in output generator plugins vary country by country, but RP2's architecture makes it possible to contribute additional generators for different countries or for different country-based cases.
RP2 has extensive unit test coverage to reduce the risk of regression.
IMPORTANT DISCLAIMERS:
- RP2 offers no guarantee of correctness (read the license): always verify results with the help of a tax professional.
- The author of RP2 is not a tax professional, but has used RP2 personally for a few years.
How RP2 Operates
RP2 has been designed to have expressive primitives that can be used as building blocks for most tax scenarios: complex tax events can be described with patterns, built on top of these primitives (see the FAQ list for examples).
For the US case, RP2 treats virtual currency as property for tax purposes, as per IRS Virtual Currency Guidance.
RP2 supports various accounting methods (e.g. FIFO, LIFO, HIFO): however, in and out lots typically don't have matching amounts, so RP2 fractions them, maps in/out lot fractions and computes the resulting cost basis and capital gains for each lot fraction.
RP2 groups lot fractions into the following taxable event categories, each of which has a specific tax treatment:
