Indexmiete Rechner
Berechnung nach Verbraucherpreisindex (Basis 2020 = 100), Tabelle 61111-0002
Quelle: Statistisches Bundesamt (Destatis); Irrtum vorbehalten
Hinweis: Es wird die Nettokaltmiete gerechnet (Indexmiete gem. § 557b BGB).

Indexmiete Berechnung

Erstellt am ${today}
${logoUrl ? `` : ``}
Beginn / letzte Anpassung
${payload.startLabel}
Berechnung bis
${payload.endLabel}
Index alt
${payload.oldIndex}
Index neu
${payload.newIndex}
Änderung
${payload.pct}
Formel
alte Miete × (Index neu ÷ Index alt)
Derzeitige Miete
${payload.rentOld}
Neue Miete
${payload.rentNew}
Erhöhung
${payload.delta}
${payload.note}
`.trim(); const w = window.open("", "_blank"); if (!w){ showError("PDF Ansicht konnte nicht geöffnet werden. Bitte Popups erlauben."); return; } w.document.open(); w.document.write(html); w.document.close(); w.onload = function(){ w.focus(); w.print(); }; } function setKpis(oldIndex, newIndex, pct, rent, newRent, delta){ el("kpiOldIndex").textContent = toIndex(oldIndex); el("kpiNewIndex").textContent = toIndex(newIndex); el("kpiPct").textContent = toPct(pct); el("kpiRentOld").textContent = toMoneyEUR(rent); el("kpiRentNew").textContent = toMoneyEUR(newRent); el("kpiDelta").textContent = toMoneyEUR(delta); } function init(){ fillYearSelect(el("startYear")); fillYearSelect(el("endYear")); fillMonthSelect(el("startMonth")); fillMonthSelect(el("endMonth")); const now = new Date(); const endY = Math.min(MAX_YEAR, now.getFullYear()); const endM = now.getMonth() + 1; const startGuess = subtractMonths(endY, endM, 12); el("startYear").value = String(Math.max(MIN_YEAR, startGuess.year)); el("startMonth").value = String(startGuess.month); el("endYear").value = String(endY); el("endMonth").value = String(endM); updateBaseYearHint(); el("startYear").addEventListener("change", updateBaseYearHint); el("startMonth").addEventListener("change", updateBaseYearHint); el("btnReset").addEventListener("click", function(){ clearError(); clearWarning(); hideResult(); el("btnPdf").disabled = true; el("rent").value = ""; forceStopLoading(); el("startYear").value = String(Math.max(MIN_YEAR, startGuess.year)); el("startMonth").value = String(startGuess.month); el("endYear").value = String(endY); el("endMonth").value = String(endM); updateBaseYearHint(); }); el("btnCalc").addEventListener("click", async function(){ clearError(); clearWarning(); hideResult(); el("btnPdf").disabled = true; const rentRaw = String(el("rent").value || "").trim(); const rent = Number(rentRaw.replace(",", ".")); if (!isFinite(rent) || rent <= 0){ showError("Bitte eine gültige Miete eingeben."); return; } let sY = Number(el("startYear").value); let sM = Number(el("startMonth").value); let eY = Number(el("endYear").value); let eM = Number(el("endMonth").value); if (ymKey(eY,eM) < ymKey(sY,sM)){ showError("Der Endzeitpunkt darf nicht vor dem Startzeitpunkt liegen."); return; } setLoading(true); try{ const oldHit = await fetchIndexNearest(sY, sM, 60); const newHit = await fetchIndexNearest(eY, eM, 60); sY = oldHit.year; sM = oldHit.month; eY = newHit.year; eM = newHit.month; if (ymKey(eY,eM) < ymKey(sY,sM)){ throw new Error("Der verfügbare End-Index liegt vor dem verfügbaren Start-Index. Bitte Zeitraum anpassen."); } const oldIndex = oldHit.index; const newIndex = newHit.index; const factor = newIndex / oldIndex; const pct = (factor - 1) * 100; const newRent = Math.round((rent * factor) * 100) / 100; const delta = Math.round((newRent - rent) * 100) / 100; setKpis(oldIndex, newIndex, pct, rent, newRent, delta); const compliance = buildComplianceWarnings(sY, sM, eY, eM, oldIndex, newIndex); const noteLines = []; noteLines.push("Formel: neue Miete = alte Miete × (Index neu ÷ Index alt)."); if (oldHit.steppedBack > 0 || newHit.steppedBack > 0){ noteLines.push(""); noteLines.push("Hinweis: Für den gewählten Monat lagen ggf. noch keine Werte vor, es wurde automatisch auf den zuletzt verfügbaren Indexmonat zurückgegriffen."); noteLines.push("Verwendeter Start: " + labelYM(sY, sM)); noteLines.push("Verwendetes Ende: " + labelYM(eY, eM)); } if (compliance.length){ noteLines.push(""); noteLines.push("Hinweise:"); compliance.forEach(x => noteLines.push("• " + x)); } el("resultNote").textContent = noteLines.join("\n"); showResult(); if (compliance.length){ showWarning(compliance.join("\n") + "\nQuelle: Statistisches Bundesamt (Destatis); Irrtum vorbehalten"); } el("btnPdf").disabled = false; el("btnPdf").onclick = function(){ openPdfPrintView({ startLabel: labelYM(sY, sM), endLabel: labelYM(eY, eM), oldIndex: toIndex(oldIndex), newIndex: toIndex(newIndex), pct: toPct(pct), rentOld: toMoneyEUR(rent), rentNew: toMoneyEUR(newRent), delta: toMoneyEUR(delta), note: noteLines.join("\n") + "\n\nQuelle: Statistisches Bundesamt (Destatis); Irrtum vorbehalten" }); }; } catch(e){ showError("Indexwerte konnten nicht geladen werden.\nDetails: " + (e && e.message ? e.message : String(e)) + "\nQuelle: Statistisches Bundesamt (Destatis); Irrtum vorbehalten"); } finally { setLoading(false); } }); } init(); })();