<?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: RemoveVAT</title>
    <description>The latest articles on DEV Community by RemoveVAT (@removevat).</description>
    <link>https://dev.to/removevat</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%2F4230312%2F6e4f8daa-4c7b-4a2b-91b3-ba64aa3199df.jpg</url>
      <title>DEV Community: RemoveVAT</title>
      <link>https://dev.to/removevat</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/removevat"/>
    <language>en</language>
    <item>
      <title>The VAT maths mistake hiding in almost every invoice tool</title>
      <dc:creator>RemoveVAT</dc:creator>
      <pubDate>Fri, 06 Nov 2026 15:42:31 +0000</pubDate>
      <link>https://dev.to/removevat/the-vat-maths-mistake-hiding-in-almost-every-invoice-tool-6pj</link>
      <guid>https://dev.to/removevat/the-vat-maths-mistake-hiding-in-almost-every-invoice-tool-6pj</guid>
      <description>&lt;p&gt;Here is a bug I keep finding in invoice tools, spreadsheet templates and "quick VAT calculators" — including, briefly, our own first prototype.&lt;/p&gt;

&lt;p&gt;A customer pays £120 for something with 20% VAT. Quick: how much of that is VAT?&lt;/p&gt;

&lt;p&gt;The instinctive answer is £24 — twenty per cent of £120. It is also wrong. The VAT inside £120 is £20, and the net is £100. Twenty per cent was added to the &lt;em&gt;net&lt;/em&gt; (£100 × 1.2 = £120), so taking twenty per cent of the &lt;em&gt;gross&lt;/em&gt; overstates the tax by a fifth. Multiply that error across a year of invoices and a business files the wrong return with total confidence.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix is one division
&lt;/h2&gt;

&lt;p&gt;To strip VAT out of a gross figure you divide by 1 + rate, you never subtract the percentage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;removeVat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;gross&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;ratePercent&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="nx"&gt;net&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;gross&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;ratePercent&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;100&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="na"&gt;net&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;round2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;net&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="na"&gt;vat&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;round2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;gross&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="nx"&gt;net&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;Adding VAT is the mirror image (multiply by 1 + rate), and the UK's Flat Rate Scheme is a third shape again: a sector percentage applied to &lt;em&gt;VAT-inclusive&lt;/em&gt; turnover, which is why comparing the scheme against standard accounting needs both calculations side by side before the numbers mean anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  We open-sourced the data and the snippet
&lt;/h2&gt;

&lt;p&gt;VAT code is only as good as its rates table, so we published ours: UK and EU standard and reduced rates plus the UK thresholds (£90,000 registration, checked against GOV.UK; EU rates against the European Commission), as CSV and JSON, with the three calculator functions, in our public repo: &lt;a href="https://github.com/removevat/uk-eu-vat-rates" rel="noopener noreferrer"&gt;uk-eu-vat-rates&lt;/a&gt;. Corrections and issues welcome — rates change, and a wrong rate in a copied snippet propagates silently.&lt;/p&gt;

&lt;h2&gt;
  
  
  The no-code version
&lt;/h2&gt;

&lt;p&gt;The same maths runs in the browser at &lt;a href="https://removevat.com/" rel="noopener noreferrer"&gt;RemoveVAT&lt;/a&gt; — a free vat calculator uk sole traders and bookkeepers use to add or remove VAT at any rate, compare the Flat Rate Scheme against standard VAT, work out reverse charge, generate VAT invoices, check UK VAT numbers and run bulk figures. No sign-up, nothing uploaded.&lt;/p&gt;

&lt;p&gt;If you maintain anything that touches VAT: grep your codebase for &lt;code&gt;* 0.2&lt;/code&gt; applied to a gross amount today. That search has a genuinely high hit rate.&lt;/p&gt;

</description>
      <category>finance</category>
      <category>tax</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
