<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Self Tax Lab</title>
    <description>The latest articles on DEV Community by Self Tax Lab (@selftaxlab).</description>
    <link>https://dev.to/selftaxlab</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4267078%2Fc4909a58-fb3f-43e5-9852-d076751bbdeb.png</url>
      <title>DEV Community: Self Tax Lab</title>
      <link>https://dev.to/selftaxlab</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/selftaxlab"/>
    <language>en</language>
    <item>
      <title>Six Tax Calculators, Six Answers: Publishing the Math Instead of the Result</title>
      <dc:creator>Self Tax Lab</dc:creator>
      <pubDate>Thu, 26 Nov 2026 14:40:36 +0000</pubDate>
      <link>https://dev.to/selftaxlab/six-tax-calculators-six-answers-publishing-the-math-instead-of-the-result-3fgn</link>
      <guid>https://dev.to/selftaxlab/six-tax-calculators-six-answers-publishing-the-math-instead-of-the-result-3fgn</guid>
      <description>&lt;p&gt;Last month I put the same number — $120,000 of self-employment profit — into six of the most-cited self-employment tax calculators on the first page of search results.&lt;/p&gt;

&lt;p&gt;I got six answers. The spread was not rounding noise; one tool's number sat four figures away from another's. On a figure that ends up on a filed return, that is not a detail.&lt;/p&gt;

&lt;p&gt;So I did the stubborn thing: I opened the Schedule SE instructions, the SSA page for the contribution and benefit base, and the IRS guidance on Additional Medicare Tax, and worked the arithmetic by hand.&lt;/p&gt;

&lt;p&gt;The errors were not exotic. They were three boring ones, repeated.&lt;/p&gt;

&lt;h4&gt;
  
  
  Error 1: skipping the 92.35% factor
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;net_se_earnings = max(0, net_profit) × 0.9235
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Employees and employers each pay half of Social Security and Medicare tax, and the employer half never shows up in the employee's income. Congress mirrored that treatment for the self-employed by taxing only 92.35% of net profit.&lt;/p&gt;

&lt;p&gt;Skip the factor and you tax the full profit at 15.3%. On $100 of profit that is $15.30 instead of $14.13 — a tax overstated by about 8%, on every single calculation the page produces. It is also invisible, because the number still &lt;em&gt;looks&lt;/em&gt; like a plausible tax figure.&lt;/p&gt;

&lt;h4&gt;
  
  
  Error 2: a wage base that expired
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ss_tax = min(net_se_earnings, max(0, wage_base − w2_wages)) × 12.4%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Social Security portion stops at an annual contribution and benefit base. For tax year 2026 that base is &lt;strong&gt;$184,500&lt;/strong&gt;. The SSA has already published &lt;strong&gt;$192,300 for 2027&lt;/strong&gt;, and it will be published again next October.&lt;/p&gt;

&lt;p&gt;A tool with last year's number baked into a constant is not "slightly stale". Above the old base it keeps charging 12.4% on earnings that are no longer taxable, and the error grows with income. This is the kind of bug that never surfaces in testing, because testing happens with round numbers like $50,000, well under the cap.&lt;/p&gt;

&lt;h4&gt;
  
  
  Error 3: the Additional Medicare Tax deducted when it shouldn't be
&lt;/h4&gt;

&lt;p&gt;The 0.9% Additional Medicare Tax is real and it has no wage cap. What it does not have is a place in the deductible half of self-employment tax.&lt;/p&gt;

&lt;p&gt;Take $300,000 of profit. The Additional Medicare Tax on it comes to about $693. If a tool folds that into the deductible half, it lets you deduct half of a tax that was never deductible — and the resulting understatement of income tax flows silently into the bottom line. Small, but real, and it compounds with filing status.&lt;/p&gt;

&lt;h4&gt;
  
  
  What I did differently
&lt;/h4&gt;

&lt;p&gt;Three commitments, all cheap to implement:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The formula goes on the page.&lt;/strong&gt; Not "our advanced algorithm" — the actual expression, with operators, in the order the code evaluates it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The test vectors are public.&lt;/strong&gt; Five profit levels, hand-computed, published in a table anyone can reproduce.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The sources are named, with a date.&lt;/strong&gt; Not "according to IRS guidance" — the specific publication, and the day it was last checked against the primary source.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There is a fourth one, which is a policy rather than a feature: &lt;strong&gt;corrections happen in public.&lt;/strong&gt; A silent fix is a lie told slowly.&lt;/p&gt;

&lt;h4&gt;
  
  
  One of these errors was mine
&lt;/h4&gt;

&lt;p&gt;A check of my own calculator turned up the exact kind of bug I had spent the week criticising. The standard deduction for Head of Household was being read from the single-filer column. In 2026 those two numbers are not close: $24,150 against $16,100.&lt;/p&gt;

&lt;p&gt;Nothing about the output looked wrong. Every figure the page produced was internally consistent — which is precisely why it survived.&lt;/p&gt;

&lt;p&gt;It is fixed, and the correction is noted on the methodology page. A policy that only applies to other people's code is not a policy.&lt;/p&gt;

&lt;h4&gt;
  
  
  The test vectors
&lt;/h4&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Net profit&lt;/th&gt;
&lt;th&gt;Net SE earnings (×0.9235)&lt;/th&gt;
&lt;th&gt;OASDI (12.4%)&lt;/th&gt;
&lt;th&gt;Medicare (2.9%)&lt;/th&gt;
&lt;th&gt;Additional (0.9%)&lt;/th&gt;
&lt;th&gt;Total&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;$400&lt;/td&gt;
&lt;td&gt;$369.40&lt;/td&gt;
&lt;td&gt;$45.81&lt;/td&gt;
&lt;td&gt;$10.71&lt;/td&gt;
&lt;td&gt;$0.00&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$56.52&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;$500&lt;/td&gt;
&lt;td&gt;$461.75&lt;/td&gt;
&lt;td&gt;$57.26&lt;/td&gt;
&lt;td&gt;$13.39&lt;/td&gt;
&lt;td&gt;$0.00&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$70.65&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;$60,000&lt;/td&gt;
&lt;td&gt;$55,410.00&lt;/td&gt;
&lt;td&gt;$6,870.84&lt;/td&gt;
&lt;td&gt;$1,606.89&lt;/td&gt;
&lt;td&gt;$0.00&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$8,477.73&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;$200,000&lt;/td&gt;
&lt;td&gt;$184,700.00&lt;/td&gt;
&lt;td&gt;$22,878.00&lt;/td&gt;
&lt;td&gt;$5,356.30&lt;/td&gt;
&lt;td&gt;$0.00&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$28,234.30&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;$300,000&lt;/td&gt;
&lt;td&gt;$277,050.00&lt;/td&gt;
&lt;td&gt;$22,878.00&lt;/td&gt;
&lt;td&gt;$8,034.45&lt;/td&gt;
&lt;td&gt;$693.45&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;$31,605.90&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two of those rows are doing specific work. The $200,000 row sits &lt;em&gt;just above&lt;/em&gt; the 2026 wage base ($184,700 of net earnings against a $184,500 cap) — it proves the cap applies at the right point and not one dollar late. The $300,000 row is the first one where the Additional Medicare Tax fires at all.&lt;/p&gt;

&lt;p&gt;Round numbers are the enemy here. They sit comfortably in the middle of every range and pass every check.&lt;/p&gt;

&lt;h4&gt;
  
  
  The whole calculation
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;WAGE_BASE_2026&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;184500&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;ADDL_MEDICARE_THRESHOLD&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;single&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;200000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mfj&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;250000&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;selfEmploymentTax&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;netProfit&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;w2Wages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;filingStatus&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'single'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;net&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;netProfit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.9235&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;ssRoom&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="no"&gt;WAGE_BASE_2026&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;w2Wages&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;oasdi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;min&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;net&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ssRoom&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.124&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;medicare&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;net&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.029&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;threshold&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;ADDL_MEDICARE_THRESHOLD&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;filingStatus&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="no"&gt;ADDL_MEDICARE_THRESHOLD&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;single&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;additional&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;max&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;net&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;w2Wages&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;threshold&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.009&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;oasdi&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;medicare&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;additional&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;total&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;oasdi&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;medicare&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;additional&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Eleven lines. The hard part was never the code — it was being certain about the three constants and the order of operations.&lt;/p&gt;

&lt;h4&gt;
  
  
  Why zero dependencies
&lt;/h4&gt;

&lt;p&gt;The calculators are single HTML files. No framework, no build step, no analytics script, no cookie banner. Part of that is performance, most of it is auditability: view-source is the complete program. If you want to know whether the number on the page comes from the formula on the page, you can check in about ninety seconds.&lt;/p&gt;

&lt;p&gt;The cost is real. No components, no reuse, every page hand-built. For a product whose entire value is one number a user can verify, I think it is the right trade.&lt;/p&gt;

&lt;h4&gt;
  
  
  On working with an AI assistant
&lt;/h4&gt;

&lt;p&gt;I write this code with an AI assistant. The useful way to describe the split is narrow: the assistant types, I verify. It does not doubt a number. Hand it a wage base from the previous year and it will use it, in clean and confident code. So every constant comes from a primary source I read myself, and the code is not allowed to disagree with it.&lt;/p&gt;

&lt;h4&gt;
  
  
  What I would tell anyone shipping a YMYL tool
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Take parameters from primary sources, never from a blog.&lt;/strong&gt; Every stale number I found was traceable to someone copying someone else.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Publish test vectors.&lt;/strong&gt; They cost an afternoon and they convert "trust us" into "check it yourself".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test at the boundaries, not the middle.&lt;/strong&gt; The cap, the threshold, the first dollar over each. Round numbers hide everything.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Be suspicious of your own arithmetic.&lt;/strong&gt; The most dangerous output is a number that looks plausible.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you spot an error in mine, the correction address is on the methodology page. I would rather be corrected in public than be right in silence.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update, 2026-11-27&lt;/strong&gt; — a correction.&lt;/p&gt;

&lt;p&gt;A reader pointed out that all five test vectors above are self-employment tax rows, so they could never have caught the filing-status bug. Self-employment tax barely looks at filing status; the standard deduction column is exactly where the error lived. He was right, and the table was a weaker safety net than I implied.&lt;/p&gt;

&lt;p&gt;Three things changed. The methodology page now carries four boundary vectors, one per filing status, positioned so AGI lands on the standard deduction to the dollar. It also states what the table above leaves implicit: the $300,000 row assumes a single filer, because its $693.45 of Additional Medicare Tax uses the $200,000 threshold — a joint filer on the same profit owes $243.45. And every constant on the calculators is now keyed by tax year, with a pre-deploy check that fails once the current date moves past the last year the table holds, so 2027 cannot quietly ship 2026's numbers.&lt;/p&gt;

&lt;p&gt;Vectors and notes: &lt;a href="https://selftaxlab.com/methodology.html" rel="noopener noreferrer"&gt;https://selftaxlab.com/methodology.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>taxes</category>
    </item>
  </channel>
</rss>
