{"id":3097,"date":"2026-01-02T17:26:24","date_gmt":"2026-01-02T17:26:24","guid":{"rendered":"https:\/\/garyhengeveld.com\/wordpress\/?p=3097"},"modified":"2026-03-23T19:29:47","modified_gmt":"2026-03-23T19:29:47","slug":"espp-xplained","status":"publish","type":"post","link":"https:\/\/garyhengeveld.com\/wordpress\/espp-xplained\/","title":{"rendered":"ESPP xplained"},"content":{"rendered":"\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<title>ESPP Calculator<\/title>\n<style>\n    body {\n        font-family: Arial, sans-serif;\n        margin: 40px;\n        background: #f5f5f5;\n    }\n    h1 { text-align: center; }\n    .container {\n        background: white;\n        padding: 25px;\n        border-radius: 10px;\n        max-width: 700px;\n        margin: auto;\n        box-shadow: 0 0 10px rgba(0,0,0,0.1);\n    }\n    label { font-weight: bold; }\n    input {\n        width: 100%;\n        padding: 8px;\n        margin: 6px 0 20px 0;\n        border-radius: 5px;\n        border: 1px solid #ccc;\n    }\n    .result {\n        background: #eef;\n        padding: 15px;\n        border-radius: 8px;\n        margin-top: 20px;\n    }\n    .positive { color: green; font-weight: bold; }\n    .negative { color: red; font-weight: bold; }\n<\/style>\n<\/head>\n<body>\n\n<div class=\"container\">\n<h1>Employee Stock Purchase Plan Calculator<\/h1>\n\n<label>Money Taken From Paycheck ($):<\/label>\n<input type=\"number\" id=\"paycheck\" value=\"2300\" step=\"0.01\">\n\n<label>Stock Price at Time of Purchase ($):<\/label>\n<input type=\"number\" id=\"purchasePrice\" value=\"1322.50\" step=\"0.01\">\n\n<label>Current Stock Price ($):<\/label>\n<input type=\"number\" id=\"currentPrice\" value=\"1322.50\" step=\"0.01\">\n\n<div class=\"result\">\n    <p><strong>Discounted Purchase Price (15% off):<\/strong> $<span id=\"discountPrice\">0<\/span><\/p>\n    <p><strong>Quantity of Shares Purchased:<\/strong> <span id=\"qty\">0<\/span><\/p>\n    <p><strong>Total Value if Sold Now:<\/strong> $<span id=\"sellValue\">0<\/span><\/p>\n    <p><strong>Profit \/ Loss:<\/strong> <span id=\"profitLoss\"><\/span><\/p>\n    <p><strong>Percentage Gain \/ Loss:<\/strong> <span id=\"percentGain\"><\/span><\/p>\n<\/div>\n<\/div>\n\n<script>\nfunction calculate() {\n    let paycheck = parseFloat(document.getElementById(\"paycheck\").value);\n    let purchasePrice = parseFloat(document.getElementById(\"purchasePrice\").value);\n    let currentPrice = parseFloat(document.getElementById(\"currentPrice\").value);\n\n    \/\/ ESPP discount rate\n    let discountRate = 0.15;\n\n    \/\/ Apply 15% ESPP discount\n    let discountedPrice = purchasePrice * (1 - discountRate);\n\n    \/\/ Shares purchased\n    let qty = paycheck \/ discountedPrice;\n\n    \/\/ Total value if sold\n    let sellValue = qty * currentPrice;\n\n    \/\/ Profit or loss in dollars\n    let profit = sellValue - paycheck;\n\n    \/\/ Percentage gain\/loss:\n    \/\/ 15% guaranteed ESPP discount + stock movement relative to purchase price\n    let stockMovePercent = ((currentPrice - purchasePrice) \/ purchasePrice) * 100;\n    let percent = stockMovePercent + (discountRate * 100);\n\n    document.getElementById(\"discountPrice\").innerText = discountedPrice.toFixed(2);\n    document.getElementById(\"qty\").innerText = qty.toFixed(9);\n    document.getElementById(\"sellValue\").innerText = sellValue.toFixed(2);\n\n    let profitLossEl = document.getElementById(\"profitLoss\");\n    profitLossEl.innerText = \"$\" + profit.toFixed(2);\n\n    if (profit >= 0) {\n        profitLossEl.className = \"positive\";\n    } else {\n        profitLossEl.className = \"negative\";\n    }\n\n    document.getElementById(\"percentGain\").innerText = percent.toFixed(2) + \"%\";\n}\n\ndocument.querySelectorAll(\"input\").forEach(input => {\n    input.addEventListener(\"input\", calculate);\n});\n\ncalculate();\n<\/script>\n\n<\/body>\n<\/html>\n\n","protected":false},"excerpt":{"rendered":"<p>ESPP Calculator Employee Stock Purchase Plan Calculator Money Taken From Paycheck ($): Stock Price at Time of Purchase ($): Current Stock Price ($): Discounted Purchase Price (15% off): $0 Quantity of Shares Purchased: 0 Total Value if Sold Now: $0 Profit \/ Loss: Percentage Gain \/ Loss:<\/p>\n","protected":false},"author":1,"featured_media":3351,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[],"class_list":["post-3097","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tools-and-utilities"],"_links":{"self":[{"href":"https:\/\/garyhengeveld.com\/wordpress\/wp-json\/wp\/v2\/posts\/3097","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/garyhengeveld.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/garyhengeveld.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/garyhengeveld.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/garyhengeveld.com\/wordpress\/wp-json\/wp\/v2\/comments?post=3097"}],"version-history":[{"count":1,"href":"https:\/\/garyhengeveld.com\/wordpress\/wp-json\/wp\/v2\/posts\/3097\/revisions"}],"predecessor-version":[{"id":3098,"href":"https:\/\/garyhengeveld.com\/wordpress\/wp-json\/wp\/v2\/posts\/3097\/revisions\/3098"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/garyhengeveld.com\/wordpress\/wp-json\/wp\/v2\/media\/3351"}],"wp:attachment":[{"href":"https:\/\/garyhengeveld.com\/wordpress\/wp-json\/wp\/v2\/media?parent=3097"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/garyhengeveld.com\/wordpress\/wp-json\/wp\/v2\/categories?post=3097"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/garyhengeveld.com\/wordpress\/wp-json\/wp\/v2\/tags?post=3097"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}