금융

대출 이자 계산기

원리금균등·원금균등·만기일시 상환별 월 상환액과 총 이자를 비교해 한 번에 계산해 보세요.

입력값은 브라우저에서만 계산되며 서버로 전송되지 않습니다.

원
%
개월

월 상환액

892,408원

매월 동일 금액

  • 대출 원금30,000,000원
  • 총 이자2,126,678원
  • 총 상환액32,126,678원

거치기간·중도상환수수료·인지세·보증료 등은 반영하지 않은 단순 계산입니다.

최근 입력0/8

입력이 3초간 멈추면 이 브라우저에 자동 저장됩니다.

입력이 3초간 멈추면 이 브라우저에만 저장됩니다. 항목을 클릭하면 그때의 입력값으로 복원됩니다.

이 도구는 이렇게 계산합니다

결과를 믿기 전에 계산 원리와 가정을 확인하세요.

  1. 원리금균등: 매월 같은 금액을 상환하며, 월이자율 r과 기간 n으로 월 상환액을 계산합니다.
  2. 원금균등: 매월 원금을 같게 나누고 남은 원금에 대한 이자를 더합니다.
  3. 만기일시: 매월 이자만 내고 만기에 원금을 상환합니다.

자주 묻는 질문

원리금균등과 원금균등은 무엇이 다른가요?

원리금균등은 매월 상환액이 같고, 원금균등은 매월 원금을 같게 나누고 남은 원금에 대한 이자를 더합니다. 원금균등은 초반 상환액이 더 높습니다.

중도상환수수료도 반영되나요?

아니요. 이 계산기는 원금·이자율·기간·상환 방식만 반영합니다. 거치기간, 중도상환수수료, 인지세, 보증료 등은 별도입니다.

제작 코드

이 페이지에서 실제로 사용하는 Vue 3 컴포넌트입니다. 계산식과 화면 구성을 그대로 확인하고 복사할 수 있습니다.

도구 전체 코드 보기
<script setup lang="ts">
import { computed, ref } from 'vue'
import { fmt, won } from '~/utils/calc'
import CalculatorHistory from '~/components/calculators/CalculatorHistory.vue'

type Method = 'equal' | 'principal' | 'bullet'

const principal = ref(30000000)
const rate = ref(4.5)
const months = ref(36)
const method = ref<Method>('equal')

const result = computed(() => {
  const p = Number(principal.value) || 0
  const annual = Number(rate.value) || 0
  const n = Math.max(1, Math.floor(Number(months.value) || 0))
  const monthlyRate = annual / 100 / 12

  if (method.value === 'equal') {
    const monthly = monthlyRate === 0 ? p / n : (p * monthlyRate) / (1 - Math.pow(1 + monthlyRate, -n))
    const total = monthly * n
    return { monthly, total, interest: total - p, first: monthly }
  }

  if (method.value === 'principal') {
    let interest = 0
    let balance = p
    const principalPart = p / n
    for (let i = 0; i < n; i++) {
      interest += balance * monthlyRate
      balance -= principalPart
    }
    return { monthly: principalPart + p * monthlyRate, total: p + interest, interest, first: principalPart + p * monthlyRate }
  }

  const interest = p * monthlyRate * n
  return { monthly: p * monthlyRate, total: p + interest, interest, first: p * monthlyRate }
})

const methodLabels: Record<Method, string> = {
  equal: '원리금균등',
  principal: '원금균등',
  bullet: '만기일시',
}
const historySnapshot = computed(() => ({
  principal: principal.value,
  rate: rate.value,
  months: months.value,
  method: method.value,
}))
const historyLabel = computed(() => `${methodLabels[method.value]} · ${fmt(principal.value)}원 · ${rate.value}% · ${months.value}개월`)
function restoreHistory(data: Record<string, unknown>) {
  principal.value = Number(data.principal) || 0
  rate.value = Number(data.rate) || 0
  months.value = Number(data.months) || 1
  method.value = data.method === 'principal' || data.method === 'bullet' ? data.method : 'equal'
}
</script>

<template>
  <div class="calc-card">
    <div class="calc-grid">
      <div class="calc-form">
        <div class="calc-field">
          <label for="loan-principal">대출 원금</label>
          <div class="calc-inline">
            <input id="loan-principal" v-model.number="principal" class="calc-input" type="number" min="0" step="1000000" inputmode="numeric" />
            <span class="calc-unit">원</span>
          </div>
        </div>
        <div class="calc-field">
          <label for="loan-rate">연 이자율</label>
          <div class="calc-inline">
            <input id="loan-rate" v-model.number="rate" class="calc-input" type="number" min="0" step="0.1" inputmode="decimal" />
            <span class="calc-unit">%</span>
          </div>
        </div>
        <div class="calc-field">
          <label for="loan-months">기간</label>
          <div class="calc-inline">
            <input id="loan-months" v-model.number="months" class="calc-input" type="number" min="1" step="1" inputmode="numeric" />
            <span class="calc-unit">개월</span>
          </div>
        </div>
        <div class="calc-field">
          <label for="loan-method">상환 방식</label>
          <select id="loan-method" v-model="method" class="calc-select">
            <option value="equal">원리금균등</option>
            <option value="principal">원금균등</option>
            <option value="bullet">만기일시</option>
          </select>
        </div>
      </div>

      <div class="calc-result" aria-live="polite">
        <p class="calc-result-label">{{ method === 'principal' ? '첫 달 상환액' : method === 'bullet' ? '월 이자' : '월 상환액' }}</p>
        <p class="calc-result-hero">{{ won(result.first) }}</p>
        <p class="calc-result-sub">{{ method === 'principal' ? '매월 원금 균등 + 잔액 이자' : method === 'bullet' ? '만기에 원금 상환' : '매월 동일 금액' }}</p>
        <ul class="calc-result-list">
          <li class="calc-result-row"><span>대출 원금</span><strong>{{ fmt(principal) }}원</strong></li>
          <li class="calc-result-row"><span>총 이자</span><strong>{{ fmt(result.interest) }}원</strong></li>
          <li class="calc-result-row total"><span>총 상환액</span><strong>{{ won(result.total) }}</strong></li>
        </ul>
      </div>
    </div>

    <p class="calc-note">거치기간·중도상환수수료·인지세·보증료 등은 반영하지 않은 단순 계산입니다.</p>
  </div>

  <CalculatorHistory tool="loan" :snapshot="historySnapshot" :label="historyLabel" @restore="restoreHistory" />
</template>
공통 입력 기록 컴포넌트 보기
<script setup lang="ts">
import { computed, onBeforeUnmount, onMounted, ref, watch } from 'vue'

interface HistoryEntry {
  id: string
  at: number
  label: string
  data: Record<string, unknown>
}

const props = defineProps<{
  tool: string
  snapshot: Record<string, unknown>
  label: string
}>()

const emit = defineEmits<{ restore: [data: Record<string, unknown>] }>()

const MAX_ENTRIES = 8
const SAVE_DELAY = 3000

const entries = ref<HistoryEntry[]>([])
const ready = ref(false)
const restoredId = ref('')
const storageKey = computed(() => `euninfo.calc-history.v1:${props.tool}`)
let saveTimer: ReturnType<typeof setTimeout> | undefined
let initialTimer: ReturnType<typeof setTimeout> | undefined
let initialSnapshot = ''

onMounted(() => {
  load()
  ready.value = true
  // 부모의 onMounted 기본값 주입(날짜 등) 뒤에 초기 상태를 캡처한다.
  initialTimer = setTimeout(() => {
    initialSnapshot = JSON.stringify(props.snapshot)
  }, 0)
})

onBeforeUnmount(() => {
  if (saveTimer) clearTimeout(saveTimer)
  if (initialTimer) clearTimeout(initialTimer)
})

watch(
  () => props.snapshot,
  () => {
    if (!ready.value) return
    if (saveTimer) clearTimeout(saveTimer)
    saveTimer = setTimeout(save, SAVE_DELAY)
  },
  { deep: true },
)

function load() {
  try {
    const raw = localStorage.getItem(storageKey.value)
    if (!raw) return
    const parsed: unknown = JSON.parse(raw)
    if (!Array.isArray(parsed)) return
    entries.value = parsed
      .filter((item): item is HistoryEntry => {
        if (!item || typeof item !== 'object') return false
        const entry = item as Partial<HistoryEntry>
        return typeof entry.id === 'string' && typeof entry.at === 'number' && typeof entry.label === 'string' && !!entry.data && typeof entry.data === 'object'
      })
      .slice(0, MAX_ENTRIES)
  } catch {
    entries.value = []
  }
}

function persist() {
  try {
    localStorage.setItem(storageKey.value, JSON.stringify(entries.value))
  } catch {
    // 저장 공간이 없거나 브라우저가 막은 경우 조용히 무시한다.
  }
}

function save() {
  const data = JSON.parse(JSON.stringify(props.snapshot)) as Record<string, unknown>
  const json = JSON.stringify(data)
  if (!entries.value.length && json === initialSnapshot) return

  const now = Date.now()
  const label = props.label.trim() || '최근 입력'
  const existing = entries.value.find((entry) => JSON.stringify(entry.data) === json)

  if (existing) {
    existing.at = now
    existing.label = label
    entries.value = [existing, ...entries.value.filter((entry) => entry.id !== existing.id)]
  } else {
    entries.value = [
      {
        id: `${now}-${Math.random().toString(36).slice(2, 8)}`,
        at: now,
        label,
        data,
      },
      ...entries.value,
    ].slice(0, MAX_ENTRIES)
  }
  persist()
}

function restore(entry: HistoryEntry) {
  emit('restore', JSON.parse(JSON.stringify(entry.data)) as Record<string, unknown>)
  restoredId.value = entry.id
  setTimeout(() => {
    if (restoredId.value === entry.id) restoredId.value = ''
  }, 1500)
}

function remove(id: string) {
  entries.value = entries.value.filter((entry) => entry.id !== id)
  persist()
}

function clear() {
  entries.value = []
  try {
    localStorage.removeItem(storageKey.value)
  } catch {
    // ignore
  }
}

function formatTime(at: number) {
  return new Intl.DateTimeFormat('ko-KR', {
    month: 'numeric',
    day: 'numeric',
    hour: '2-digit',
    minute: '2-digit',
  }).format(new Date(at))
}
</script>

<template>
  <section class="calc-history" aria-label="최근 입력 기록">
    <div class="calc-history-head">
      <strong>최근 입력</strong>
      <span class="calc-history-count">{{ entries.length }}/{{ MAX_ENTRIES }}</span>
      <button v-if="entries.length" type="button" class="calc-history-clear" @click="clear">전체 삭제</button>
    </div>

    <p v-if="!entries.length" class="calc-history-empty">
      입력이 3초간 멈추면 이 브라우저에 자동 저장됩니다.
    </p>
    <ul v-else class="calc-history-list">
      <li v-for="entry in entries" :key="entry.id" class="calc-history-row" :class="{ restored: restoredId === entry.id }">
        <button type="button" class="calc-history-load" :aria-label="`${entry.label} 입력값 불러오기`" @click="restore(entry)">
          <span class="calc-history-label">{{ entry.label }}</span>
          <time class="calc-history-time">{{ formatTime(entry.at) }}</time>
        </button>
        <button type="button" class="calc-history-remove" :aria-label="`${entry.label} 기록 삭제`" @click="remove(entry.id)">×</button>
      </li>
    </ul>

    <p class="calc-history-note">
      입력이 3초간 멈추면 이 브라우저에만 저장됩니다. 항목을 클릭하면 그때의 입력값으로 복원됩니다.
    </p>
  </section>
</template>

함께 쓰면 좋은 도구

이런 계산기가 필요하세요?

우리 업무에 맞는 계산기·관리 도구를 함께 만들 수 있습니다.

의뢰 등록하기