Free Sales Tax Calculator Tool Earn Money Online



To use this tool, simply input the total cost of your purchase and the tax rate as a percentage (e.g. 7.5 for a 7.5% tax rate), and the tool will calculate the sales tax and the total cost with tax included.

Note that this is a very basic tool and does not take into account any exemptions or special tax rules that may apply in your area. It's always a good idea to consult with a tax professional if you have questions about how sales tax applies to your specific situation.


 <!DOCTYPE html>

<html>
<head>
  <title>Sales Tax Calculator</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <style>
    body {
      font-family: Arial, sans-serif;
      font-size: 16px;
    }
    .container {
      max-width: 600px;
      margin: 0 auto;
      padding: 20px;
    }
    label {
      display: block;
      margin-bottom: 10px;
    }
    input[type="number"], textarea {
      padding: 10px;
      border-radius: 5px;
      border: 1px solid #ccc;
      width: 100%;
      box-sizing: border-box;
      margin-bottom: 20px;
      font-size: 16px;
    }
    button {
      background-color: #4CAF50;
      color: white;
      padding: 10px 20px;
      border: none;
      border-radius: 5px;
      cursor: pointer;
      font-size: 16px;
    }
    button:hover {
      background-color: #3e8e41;
    }
    #result {
      font-size: 20px;
      margin-top: 20px;
      text-align: center;
    }
  </style>
</head>
<body>
  <div class="container">
    <h1>Sales Tax Calculator</h1>
    <form>
      <label for="subtotal">Subtotal:</label>
      <input type="number" id="subtotal" name="subtotal" placeholder="Enter subtotal amount">
      
      <label for="tax_rate">Tax rate:</label>
      <input type="number" id="tax_rate" name="tax_rate" placeholder="Enter tax rate in percentage">
      
      <label for="comments">Comments:</label>
      <textarea id="comments" name="comments" rows="4" placeholder="Enter any additional comments"></textarea>
      
      <button type="button" onclick="calculateTax()">Calculate</button>
    </form>
    
    <div id="result"></div>
  </div>
  
  <script>
    function calculateTax() {
      const subtotal = document.getElementById("subtotal").value;
      const taxRate = document.getElementById("tax_rate").value;
      const comments = document.getElementById("comments").value;
      
      const taxAmount = (subtotal * taxRate) / 100;
      const totalAmount = Number(subtotal) + Number(taxAmount);
      
      const result = `Subtotal: $${subtotal}<br>
                      Tax rate: ${taxRate}%<br>
                      Tax amount: $${taxAmount.toFixed(2)}<br>
                      Total amount: $${totalAmount.toFixed(2)}<br>
                      Comments: ${comments}`;
      
      document.getElementById("result").innerHTML = result;
    }
  </script>
</body>
</html>

Comments

Popular posts from this blog

Code of YouTube Thumbnail Downloader Tool In HTML with JS

HTML CODING FOR CALCULATOR