• Skip to main content
  • Skip to footer

Damiens Law Firm

Tax Attorney

FREE EBOOK: How To Survive The IRS

601-957-9672

  • Tax Problems
    • Asset Seizure
    • Back Taxes
    • IRS Collection Notices
      • IRS Form 9297
      • CP504 Notice
    • Non-Filed Tax Returns
    • Payroll Taxes
    • Penalty for Filing a False Tax Return
    • Tax Audits
    • Tax Levies
    • Tax Liens
    • Tax Penalties
    • Wage Garnishment
      • IRS Wage Garnishment FAQs
    • Tax Debt Attorney in Mississippi: IRS & MS DOR Representation
      • IRS Tax Audit Attorney Mississippi
  • Tax Relief
    • Bankruptcy Options
    • Currently Not Collectible
    • Innocent Spouse Relief
    • Offer in Compromise
    • Payment Plans
    • Penalty Abatement
    • Tax Audit Defense
    • IRS Tax Appeals
    • IRS Forgiveness Programs
    • Tax Transcript Review
    • Tax Attorney
    • Memphis Tax Attorney
      • Tax Debt Attorney Memphis, TN
      • Tax Resolution Services Memphis, TN
      • IRS Tax Audit Attorney Memphis, TN
      • Memphis Payroll Tax Lawyer
      • Memphis Wage Garnishment Lawyer
      • Memphis Penalty Abatement Attorney
      • Memphis IRS Audit Attorney
      • Memphis Asset Seizure Attorney
      • Memphis Tax Levy Lawyer
      • Memphis Currently Not Collectible Attorney
      • Memphis Innocent Spouse Relief Attorney
      • Memphis Offer in Compromise Attorney
  • Tax Strategies
    • Historical Bookkeeping & Accounting
    • Estate Tax Planning
    • Estate Planning
    • Tax Planning
  • Learning Center
  • Blog
  • FAQs
    • Buying a House with IRS Tax Debt? Know What to Expect
    • Can the IRS Arrest You?
    • Can You Buy a House If You Owe Taxes?
    • Can You Go to Jail for Unpaid Taxes?
    • Do You Need a Lawyer for an IRS Tax Audit?
    • How Can a Truck Driver Settle Back Taxes With the IRS?
    • What Do I Do if I Receive an IRS Payroll Tax Audit?
    • What To Do if You Receive an IRS Tax Notice
    • Can a Tax Debt Attorney in Mississippi Help You Navigate the IRS Fresh Start Program?
    • Demystifying IRS Payment Programs: How Can a Tax Debt Attorney in Mississippi Assist You?
    • Can a Tax Debt Attorney in Mississippi Shield You from IRS Liability When Your Spouse Owes Back Taxes?
    • Can the IRS Freeze My Bank Account?
    • IRS Wage Garnishment
    • What is the Employee Retention Credit (ERC)?
    • How to Remove IRS Penalties: Your Ultimate Guide to Penalty Relief
    • 10 Steps to Resolving Your IRS Tax Issues
    • Can I Get Married if My Fiance Owes Taxes?
    • How Do I Initiate an Offer in Compromise to the IRS?
    • What are Mississippi Payroll Taxes?
    • What is a Final Notice and a Notice of Intent to Levy?
    • Can I Get Help With Wage Garnishment?
    • Can the IRS Garnish My Wages?
    • Unlock Tax Relief: Learn How to Qualify for IRS Tax Forgiveness
    • What’s the Difference Between a Tax Attorney and a CPA? 
    • Top 3 Advantages Of Married Filing Separately
  • About
    • About Damiens Law
    • Our Tax Law Team
    • Reviews
  • Contact Us
Lawyers strategizing

IRS Offer in Compromise Calculator

GET OUR FREE EBOOK

How to Survive the IRS

DOWNLOAD YOUR COPY

  • Tax Strategies
  • Historical Bookkeeping & Accounting
  • Estate Planning
  • Estate Tax Planning
  • Tax Planning
  • Tax Relief
  • "Excellent and professional work helping with our business and personal legal and estate planning needs."

    - Natural Restorations

  • "I would highly recommend this firm to anyone needing legal assistance."

    - Julian Wolfe

  • "I have referred all of my clients with any Tax related issues to Joseph Damiens."

    - Damian Holcomb

This IRS offer in compromise calculator uses IRS formulas, eligibility criteria, and your income and asset numbers to show you an estimate of your potential tax settlement. Similar to the IRS’s OIC pre-qualifier tool, it helps you see whether an offer in compromise might be the right option for your tax debt. 

It also shows you how to get help if you don’t meet the eligibility criteria and explains when to work with a tax attorney so you don’t end up paying more than you need to or having your offer rejected. Get help from our offer in compromise attorneys now – or look at settlement possibilities with the offer in compromise calculator.

Offer in Compromise Qualifier | Damiens Law

IRS Offer in Compromise Qualifier

See whether you can apply for an Offer in Compromise right now, and whether settling for less than you owe is realistic, using the same rules and formulas the IRS applies.

Answer a few questions to get an honest read and your next step. It takes about two minutes.

1Debt
2Eligibility
3Income
4Assets

What you owe

Let’s start with the basics.

$
Please enter your total tax debt.

Can you apply right now?

Before the IRS will even look at an offer, a few things have to be true. These do not stop you from getting an estimate, but they decide whether you can apply today.

Have you filed all of your required tax returns?
Are you currently in an open bankruptcy?
Are you currently under an open IRS audit?
If you are required to make estimated tax payments (for example, self-employed), are you current on this year’s payments?
Please answer all four questions.

Your monthly income and expenses

The IRS looks at what is left each month after your necessary living costs. We will work that out for you.

$
Your total household income each month before taxes, including wages, self-employment, and any other regular income.
Please enter your monthly gross income.
$
What you spend each month on necessities: housing, utilities, food, transportation, health care, and insurance. Do not include any payments toward the tax debt itself.
Please enter your monthly living expenses (enter 0 if none).
Estimated monthly disposable income$0

Your assets

The IRS looks at what your assets are worth, minus what you owe against them.

$
Include home, vehicles, bank accounts, retirement accounts, and investments at their fair market value.
Please enter your total assets (enter 0 if none).
$
Include mortgages, car loans, and other loans secured by the assets above.
Please enter secured debt (enter 0 if none).

Your Offer in Compromise results

Based on IRS eligibility rules and the Reasonable Collection Potential formula

Lump sum offer
$0
Formula: (disposable income × 12) + net equity
Paid within 5 months of acceptance
Periodic offer
$0
Formula: (disposable income × 24) + net equity
Paid over 6 to 24 months
Higher total, more flexible schedule

How this was calculated

Monthly disposable income
$0 / month
Gross income minus living expenses
Net realizable equity
$0
Assets × 80% quick sale value, minus secured debt
Total tax debt
$0
Potential savings (lump sum)
$0

One important caveat about this estimate

This estimate uses the living expenses you entered. The IRS does not use your actual spending. It applies its own allowable living expense standards (the IRS Collection Financial Standards), which are often lower than what people really spend. That means the IRS may count more monthly disposable income than shown here, which would raise the offer amount it expects, so your real number could be higher than this estimate. Running your finances against the actual IRS standards is one of the main things a tax professional does, and it is often the difference between an offer that gets accepted and one that gets rejected.

Other options worth considering

    Why it is worth talking to a tax professional

    • They use the IRS’s numbers, not yours. A professional calculates your disposable income against the actual IRS allowable standards, which is the figure that decides your real offer amount.
    • Most offers get pushback. The IRS challenges asset values and disclosures. A professional prepares the offer and defends it through that review, where many self-filed offers fall apart.
    • They clear what is blocking you. If you have unfiled returns, an open audit, or a bankruptcy, a professional helps resolve those in the right order so you can actually become eligible.
    • They find the better path if an offer is not it. If an offer is not your best option, a professional points you to the one that is, instead of wasting the application fee and months of waiting.
    • Finding out costs nothing. Damiens Law offers a free, confidential consultation to review your situation.
    Talk to a tax attorney about your options Free consultation · 601-957-9672
    Important: This tool is an educational estimate only and is not legal or tax advice, and it does not create an attorney-client relationship. It uses IRS formulas, including the 80% quick sale rule for assets, but your actual Offer in Compromise amount and eligibility depend on the IRS’s review of your complete, verified financial situation (Form 656 and Form 433-A (OIC)). No outcome is promised or guaranteed. The only way to know your real number and your best path is a full financial review with a tax attorney.
    KGZ1bmN0aW9uKCl7CiAgdmFyIExJTktTPXsKICAgIG9pYzoiaHR0cHM6Ly9kYW1pZW5zbGF3LmNvbS90YXgtcmVsaWVmL29mZmVyLWluLWNvbXByb21pc2UvIiwKICAgIHBheW1lbnQ6Imh0dHBzOi8vZGFtaWVuc2xhdy5jb20vdGF4LXJlbGllZi9wYXltZW50LXBsYW5zLyIsCiAgICBwcGlhOiJodHRwczovL2RhbWllbnNsYXcuY29tL3RheC1yZWxpZWYvcGF5bWVudC1wbGFucy90d28taXJzLXBheW1lbnQtcGxhbnMvIiwKICAgIGNuYzoiaHR0cHM6Ly9kYW1pZW5zbGF3LmNvbS90YXgtcmVsaWVmL2N1cnJlbnRseS1ub3QtY29sbGVjdGlibGUvIiwKICAgIHBlbmFsdHk6Imh0dHBzOi8vZGFtaWVuc2xhdy5jb20vdGF4LXJlbGllZi9wZW5hbHR5LWFiYXRlbWVudHMvIiwKICAgIHVuZmlsZWQ6Imh0dHBzOi8vZGFtaWVuc2xhdy5jb20vdGF4LXByb2JsZW1zL25vbi1maWxlZC1yZXR1cm5zLyIsCiAgICBhdWRpdDoiaHR0cHM6Ly9kYW1pZW5zbGF3LmNvbS90YXgtcmVsaWVmL3RheC1hdWRpdC1kZWZlbnNlLyIsCiAgICBiYW5rcnVwdGN5OiJodHRwczov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ZW50PSckMCc7CiAgICBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcuZGxvaWMnKS5zY3JvbGxJbnRvVmlldyh7YmVoYXZpb3I6J3Ntb290aCcsYmxvY2s6J3N0YXJ0J30pOwogIH0pOwp9KSgpOwo=

    How to Use This IRS Offer Calculator

    Want to see if you might qualify for an offer and if so, how much? It’s just four steps: 

    1. Enter what you owe
    2. Answer a few questions about unfiled returns, bankruptcy, & estimated tax payments
    3. Put in your monthly income and expenses
    4. Enter the value of your assets and what you owe on them

    Then, the offer in compromise calculator will let you know if an offer is right for you and how much the IRS might settle for. The possible results include:

    • You’re not eligible to apply right now.
    • You’re possibly eligible for a settlement and how much.
    • You’re more likely to qualify for a different option like a payment plan or currently not collectible status. 

    If you’re curious about what offer the IRS might accept or even whether a settlement is even possible in your situation, this tool is the perfect place to start your research. But use the offer in compromise calculator with the awareness that it just looks at the basics; the IRS looks at a lot more.

    How the IRS Actually Calculates an Offer

    Here’s how the IRS determines what to accept when calculating an offer in compromise. If you’re ready for a deep dive, this overview can help you interpret your settlement options from the OIC calculator with a bit more nuance as well. 

    Reasonable collection potential – it’s what the IRS could reasonably collect from you if they had to go in and just take the money. It’s also the amount the agency will accept when you apply for an offer in compromise. So, how do you calculate RCP:

    • Asset value: 100% of cash and liquid assets, 80% (aka quick sales value) of most physical assets minus the amount you owe. 
    • Disposable income: your monthly income after taxes, minus your expenses but only up to the IRS’s expense standard. They set limits for what they accept on everything from house payments to grocery bills. 
    • The math: your asset value plus your disposable income for 12 or 24 months. The IRS uses a year of disposable income if you want to settle in a lump sum and two years’ worth if you settle over 24-monthly payments.

    For example, say your asset equity is $20,000 and your monthly disposable income is $1,000. The lump sum settlement would be: $20,000 + 12 x $1,000 = $32,000. But the periodic payment settlement would be: $20,000 + 24 x $1,000 = $44,000.

    An Offer in Compromise Calculator Can Only Take You So Far

    The math is complicated – the calculator does the basics but skips some details. The asset values (for example, the value of your home) are subjective – don’t overinflate the value of your home or you’ll end up overpaying. Extenuating circumstances can also affect the amount of your offer – even if you’re using a calculator that takes the IRS’s collection standards for the current tax year into account, it won’t be able to factor in arguments that convince the IRS to increase the numbers. 

    The calculator also doesn’t ask about the collection statute expiration date (CSED) – that date can determine strategy, and sometimes, it’s best not to apply when the debt is about to age out anyway. 

    Why should you use an offer in compromise calculator? To start your research, to get an idea if you might qualify, and to learn more about the other options that can help when you owe tax debt you can’t afford to pay. But you should always apply with the help of a tax professional. 

    How Damiens Law Helps With Offers in Compromise

    When you hire Damiens Law to represent you, we run your numbers against the actual IRS allowable standards, calculate the lowest possible offer based on all the case factors, prepare and defend the offer through IRS review, and handle any road blocks such as unfiled returns before the application goes in.

    FAQs

    How much should I offer the IRS in an offer in compromise? 

    You should offer the IRS the lowest possible amount you can get accepted under the law. To find that number, consult with an attorney, or complete the RCP calculations in IRS packet 656-B but also read the instructions to learn about extenuating circumstances or when to pursue an offer under effective tax administration. 

    How do I get an offer in compromise approved? 

    Ensure you meet the pre-qualification requirements, submit a fully complete application, make sure your expenses are allowable with the IRS’s standards, and base your offer on your reasonable collection potential. Work with an experienced tax attorney for best results.

    How long does an offer in compromise take?

    It can take anywhere from six months to two years, but when an attorney is handling it, they deal with the IRS, all collections are stopped, and you’re off the hook until the case is done. The relief comes right away on some level, even though the settlement approval can take a while.

    Can I still qualify if I owe payroll or business taxes?

    Yes, but the stakes are higher, and the process is harder for settling payroll taxes. An experienced offer in compromise attorney, especially one who’s secured offers on trust fund taxes, is key here. 

    What is the IRS offer in compromise acceptance rate?

    It varies from year to year, but normally about 40 to 70% of offers get accepted. That means that the IRS rejects over half of all offers in many years – in a good year, the agency might accept a quarter or a third of the applications. The ones that get rejected the most tend to make mistakes that are easy to avoid when you work with a professional. 

    What if my offer gets rejected?

    You should reach out to an attorney and appeal or reapply depending on the situation. Don’t apply using an offer from a calculator. Always work with an attorney to ensure the highest success rates. 

    Get Real Help With an Offer in Compromise

    You’ve looked at the calculator, and now it’s time to talk with a professional. Get help from a local attorney to file an offer in compromise.

    Our consultations are free, confidential, and no pressure. We’ll run the numbers and take you through the process. Just contact us online or by phone at (601) 957-9672 to learn about our Offer in Compromise services and how the attorneys at Damiens Law can help with your case.

    Footer

    Get Started - We are ready to fight for you!

    Damiens Law

    601-957-9672

    Facebook
    Avvo
    Linkedin
    Ridgeland Office

    996 Northpark Dr., Suite A
    Ridgeland, MS 39157

    Map and Directions

    Gulfport Office

    2218 17th Street
    Gulfport, MS 39501

    Map and Directions

    Memphis Office

    1331 Union Ave., Suite 918
    Memphis, TN 38104

    Map and Directions

    This field is for validation purposes and should be left unchanged.
    First Name(Required)
    Name(Required)
    • Tax Relief
    • Tax Strategies
    • About Us
    • Terms of Service
    • Privacy Policy
    • Site Map

    © 2026 All Rights Reserved. | This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. | The information on this website is for general information purposes only. Nothing on this site should be taken as legal advice for any individual case or situation. This information is not intended to create, and receipt or viewing does not constitute, an attorney-client relationship.

    Schedule a free, no obligation 15-minute discovery call

    Do any of the following scenarios describe your current situation?

    • You’re being audited. 
    • You owe money to the government. 
    • You want to save money on taxes. 
    • You’re going through a divorce or have a complex tax issue.

    If so, book a call below to see how we can help!