🇺🇸 미국주식 해외주식 양도소득세 계산기 (2026년 기준)
거래 내역을 한 줄씩 추가한 후 계산하기 버튼을 누르세요.
| 종목 | 매수일 (YYYY-MM-DD) | 매수수량 | 매수가 (USD) | 매수환율 | 매도일 (YYYY-MM-DD) | 매도수량 | 매도가 (USD) | 매도환율 | 수수료 (원) | 작업 |
|---|
<pre><code>
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>미국주식 해외주식 양도소득세 계산기 (2026년 기준)</title>
<style>
body { font-family: '맑은 고딕', sans-serif; max-width: 1000px; margin: 20px auto; padding: 20px; background: #f9f9f9; }
h1 { text-align: center; color: #1a73e8; }
table { width: 100%; border-collapse: collapse; margin: 20px 0; background: white; }
th, td { border: 1px solid #ccc; padding: 10px; text-align: center; }
th { background: #f1f1f1; }
input, button { padding: 8px; margin: 5px; font-size: 16px; }
button { background: #1a73e8; color: white; border: none; cursor: pointer; }
button:hover { background: #1557b0; }
.result { font-size: 18px; font-weight: bold; margin: 20px 0; padding: 15px; background: white; border: 2px solid #1a73e8; border-radius: 8px; }
.positive { color: #d32f2f; }
.negative { color: #388e3c; }
</style>
</head>
<body>
<h1>🇺🇸 미국주식 해외주식 양도소득세 계산기 (2026년 기준)</h1>
<p style="text-align:center;">거래 내역을 한 줄씩 추가한 후 <strong>계산하기</strong> 버튼을 누르세요.</p>
<table id="tradeTable">
<thead>
<tr>
<th>종목</th>
<th>매수일 (YYYY-MM-DD)</th>
<th>매수수량</th>
<th>매수가 (USD)</th>
<th>매수환율</th>
<th>매도일 (YYYY-MM-DD)</th>
<th>매도수량</th>
<th>매도가 (USD)</th>
<th>매도환율</th>
<th>수수료 (원)</th>
<th>작업</th>
</tr>
</thead>
<tbody id="tbody"></tbody>
</table>
<button onclick="addRow()">+ 거래 행 추가</button>
<button onclick="calculateTax()" style="background:#34a853;">📊 계산하기</button>
<button onclick="clearAll()" style="background:#fbbc05;">초기화</button>
<div id="result" class="result" style="display:none;"></div>
<script>
let rowCount = 0;
function addRow() {
rowCount++;
const tbody = document.getElementById('tbody');
const row = document.createElement('tr');
row.innerHTML = `
<td><input type="text" id="stock${rowCount}" placeholder="AAPL" style="width:80px;"></td>
<td><input type="date" id="buyDate${rowCount}"></td>
<td><input type="number" id="buyQty${rowCount}" step="0.001" value="100" style="width:80px;"></td>
<td><input type="number" id="buyPrice${rowCount}" step="0.01" value="220.5" style="width:90px;"></td>
<td><input type="number" id="buyRate${rowCount}" step="0.01" value="1380" style="width:80px;"></td>
<td><input type="date" id="sellDate${rowCount}"></td>
<td><input type="number" id="sellQty${rowCount}" step="0.001" value="100" style="width:80px;"></td>
<td><input type="number" id="sellPrice${rowCount}" step="0.01" value="245.3" style="width:90px;"></td>
<td><input type="number" id="sellRate${rowCount}" step="0.01" value="1450" style="width:80px;"></td>
<td><input type="number" id="fee${rowCount}" step="1" value="45000" style="width:90px;"></td>
<td><button onclick="this.parentElement.parentElement.remove()">삭제</button></td>
`;
tbody.appendChild(row);
}
function calculateTax() {
let totalGain = 0;
let details = '';
const rows = document.querySelectorAll('#tbody tr');
rows.forEach(row => {
const stock = row.querySelector('input[id^="stock"]').value || '종목';
const buyQty = parseFloat(row.querySelector('input[id^="buyQty"]').value) || 0;
const buyPrice = parseFloat(row.querySelector('input[id^="buyPrice"]').value) || 0;
const buyRate = parseFloat(row.querySelector('input[id^="buyRate"]').value) || 0;
const sellQty = parseFloat(row.querySelector('input[id^="sellQty"]').value) || 0;
const sellPrice = parseFloat(row.querySelector('input[id^="sellPrice"]').value) || 0;
const sellRate = parseFloat(row.querySelector('input[id^="sellRate"]').value) || 0;
const fee = parseFloat(row.querySelector('input[id^="fee"]').value) || 0;
if (buyQty === 0 || sellQty === 0) return;
const buyAmount = buyQty * buyPrice * buyRate;
const sellAmount = sellQty * sellPrice * sellRate;
const gain = sellAmount - buyAmount - fee;
totalGain += gain;
details += `<tr>
<td>${stock}</td>
<td>${buyQty.toFixed(2)}주 × ${buyPrice} × ${buyRate} = ${buyAmount.toLocaleString()}원</td>
<td>${sellQty.toFixed(2)}주 × ${sellPrice} × ${sellRate} = ${sellAmount.toLocaleString()}원</td>
<td class="${gain >= 0 ? 'positive' : 'negative'}">${gain.toLocaleString()}원</td>
</tr>`;
});
const deduction = 2500000;
const taxable = Math.max(totalGain - deduction, 0);
const tax = Math.round(taxable * 0.22);
let html = `
<h2>계산 결과 (2026년 기준)</h2>
<p><strong>총 양도차익 (손익 통산)</strong>: <span class="${totalGain >= 0 ? 'positive' : 'negative'}">${totalGain.toLocaleString()}원</span></p>
<p>기본공제 250만원 차감 후 <strong>과세표준</strong>: ${taxable.toLocaleString()}원</p>
<p><strong>예상 양도소득세 (22%)</strong>: <span style="font-size:22px;color:#d32f2f;">${tax.toLocaleString()}원</span></p>
<hr>
<h3>거래 상세 내역</h3>
<table style="width:100%;"><thead><tr><th>종목</th><th>취득가액</th><th>양도가액</th><th>양도차익</th></tr></thead><tbody>${details}</tbody></table>
<p style="font-size:13px;color:#666;">※ 실제 신고 시 한국은행 기준환율(결제일)과 IBKR 거래내역을 정확히 확인하세요. FIFO 방식, 부분매도 등은 직접 조정 필요합니다.</p>
`;
document.getElementById('result').innerHTML = html;
document.getElementById('result').style.display = 'block';
}
function clearAll() {
if (confirm('모든 거래를 초기화하시겠습니까?')) {
document.getElementById('tbody').innerHTML = '';
document.getElementById('result').style.display = 'none';
rowCount = 0;
}
}
// 페이지 로드 시 첫 번째 행 자동 추가
window.onload = () => {
addRow();
};
</script>
</code></pre></body>
</html>
#withmake.kr

댓글 쓰기