Skip to content
A Ruby gem for calculating Roth IRA contribution amounts
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

CircleCI Gem Version Code Climate


This Ruby gem allows you to calculate maximum Roth IRA contributions based on Modified Adjusted Gross Income (MAGI), Age, Filing Status, and Tax Year. Guidelines for these calculations were taken from the IRS Publications on Roth IRAs.

Contribution and income limits may vary every year, and thus changes to the code will be required. This gem is currently up to date for Tax Years 2015 - 2017.


In your gemfile, add

gem 'roth_ira', '~> 1.2.0'

then run bundle install.

Alternatively, you can manually install the gem.

gem install roth_ira


Version 1.0+

To calculate a contribution limit, initialize a new RothIRA object with the tax year. Then, call calculate_limit, and pass MAGI, filing status, age, and (optionally) spouse age.

> roth_ira =
> roth_ira.calculate(75000, :single, 25)
> RothIRA.calculate(75000, :married_filing_jointly, 25)

Older versions

Next, call the method RothIRA.calculate_limit and pass four parameters: MAGI, filing status as a symbol (:single, :married_filing_jointly), age, and (optionally) spouse's age.

RothIRA.calculate_limit(75000, :single, 25)
> 5500
RothIRA.calculate_limit(75000, :married_filing_jointly, 49)
> 11000
RothIRA.calculate_limit(75000, :married_filing_jointly, 49, 50)
> 12000

Version Note

roth_ira follows semantic versioning. New with version 1.0.0, year is no longer an optional parameter and must be specified. Additionally, implementation has shifted from module methods to class instance methods.

You can’t perform that action at this time.