]> git.scottworley.com Git - inverse-tax/blob - index.html
6702ed3918626c0565af80e42144c3ebfa5e8bf9
[inverse-tax] / index.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="tax.js"></script>
5 <script src="tax_ui.js"></script>
6 <!-- Tests are in tax.test.js -->
7 <style>
8 td { padding: .5em; vertical-align: top}
9 textarea { height: 12em; }
10 textarea.small { height: 4em; }
11 input { width: 7em }
12 .output { padding: 1em; background-color: #eee; border: thin solid #888; width: max-content; }
13 .privacy_policy { margin-top: 5em; }
14 </style>
15 </head>
16 <body onload="calculate()">
17 <h1>Inverse income tax tool</h1>
18 <p>What before-tax salary is needed to provide a specified after-tax salary?</p>
19
20 <form>
21 <table>
22 <tr>
23 <td>
24 Federal deductible<br/><input id="deductible_1" value="27700" onchange="calculate()" oninput="calculate()"/>
25 </td>
26 <td>
27 State deductible<br/><input id="deductible_2" value="10404" onchange="calculate()" oninput="calculate()"/>
28 </td>
29 </tr>
30 <tr>
31 <td>
32 Federal tax table<br/>
33 <textarea id="tax_table_1" onchange="calculate()" oninput="calculate()"> 0 10
34 22000 12
35 89450 22
36 190750 24
37 364200 32
38 462500 32
39 683750 35</textarea>
40 </td>
41 <td>
42 State tax table<br/>
43 <textarea id="tax_table_2" onchange="calculate()" oninput="calculate()"> 0 1
44 20198 2
45 47884 4
46 76576 6
47 104910 8
48 132590 9.3
49 677278 10.3
50 812728 11.3
51 1354550 12.3</textarea>
52 <br/>(Initial table is California's)
53 </td>
54 </tr>
55 <tr>
56 <td>
57 Social Security tax<br/>
58 <textarea id="tax_table_3" class="small" onchange="calculate()" oninput="calculate()"> 0 6.2
59 160200 0</textarea>
60 </td>
61 <td>
62 Medicare tax<br/>
63 <textarea id="tax_table_4" class="small" onchange="calculate()" oninput="calculate()"> 0 1.45
64 250000 2.35</textarea>
65 </td>
66 </tr>
67 <tr>
68 <td colspan="2">
69 Desired after-tax salary</br>
70 <input id="after_tax" value="100000" onchange="calculate()" oninput="calculate()">
71 </td></tr>
72 </table>
73 </form>
74
75 <p class="output">
76 <strong><span id="before_tax"></span> before tax</strong>
77 - <span id="tax_1"></span> federal tax
78 - <span id="tax_2"></span> state tax
79 - <span id="tax_3"></span> social security tax
80 - <span id="tax_4"></span> medicare tax
81 = <span id="after_tax_verification"></span> after tax.
82 </p>
83
84 <p class="privacy_policy">Privacy policy: All calculations are client-side; no figures are sent to any server.</p>
85 </body>
86 </html>