Remove VAT from a price tool (with code for your website)
Remove VAT from any price at any rate with this tool, and copy the commented HTML and JavaScript for your own website.
You can use the tool below to remove VAT from any price. It defaults to 20% but you can change this to any value you like.
The code to use on your website is included. A link back would be appreciated 😉
VAT removal tool
<!DOCTYPE html>
<html>
<head>
<title>VAT Removal Tool</title>
<script>
// Function to remove VAT from the price
function removeVAT() {
// Get the input price and VAT rate from the form
var priceWithVAT = document.getElementById("priceWithVAT").value;
var vatRate = document.getElementById("vatRate").value;
// Calculate VAT multiplier
var vatMultiplier = (100 + parseFloat(vatRate)) / 100;
// Calculate and display the price without VAT
var priceWithoutVAT = priceWithVAT / vatMultiplier;
document.getElementById("result").innerHTML = "Price without VAT: " + priceWithoutVAT.toFixed(2);
}
</script>
</head>
<body>
<h1>VAT Removal Tool</h1>
<!-- Input form for price and VAT rate -->
<form>
<label for="priceWithVAT">Enter price (with VAT):</label>
<input type="number" id="priceWithVAT" name="priceWithVAT" required><br><br>
<label for="vatRate">VAT Rate (%):</label>
<input type="number" id="vatRate" name="vatRate" value="20" required><br><br>
<input type="button" value="Remove VAT" onclick="removeVAT()">
</form>
<br><br>
<!-- Div to display the result -->
<div id="result"></div>
</body>
</html>