Georgia Closing Cost Calculator – Estimate Your Real Estate Expenses
:root {
–primary-color: #004a99;
–success-color: #28a745;
–background-color: #f8f9fa;
–text-color: #333;
–border-color: #ddd;
–shadow-color: rgba(0, 0, 0, 0.1);
–card-background: #fff;
–error-color: #dc3545;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: var(–background-color);
color: var(–text-color);
line-height: 1.6;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
align-items: center;
padding-bottom: 50px;
}
.container {
width: 100%;
max-width: 1000px;
margin: 0 auto;
padding: 20px;
box-sizing: border-box;
}
header {
background-color: var(–primary-color);
color: white;
padding: 20px 0;
text-align: center;
width: 100%;
margin-bottom: 30px;
}
header h1 {
margin: 0;
font-size: 2.5em;
font-weight: 700;
}
main {
width: 100%;
background-color: var(–card-background);
padding: 30px;
border-radius: 8px;
box-shadow: 0 4px 15px var(–shadow-color);
margin-bottom: 30px;
}
.loan-calc-container {
margin-bottom: 30px;
padding: 25px;
border: 1px solid var(–border-color);
border-radius: 8px;
background-color: #fdfdfd;
}
.loan-calc-container h2 {
text-align: center;
color: var(–primary-color);
margin-top: 0;
margin-bottom: 25px;
font-size: 1.8em;
}
.input-group {
margin-bottom: 20px;
display: flex;
flex-direction: column;
}
.input-group label {
display: block;
margin-bottom: 8px;
font-weight: 600;
color: var(–primary-color);
}
.input-group input[type="number"],
.input-group input[type="text"],
.input-group select {
width: 100%;
padding: 12px 15px;
border: 1px solid var(–border-color);
border-radius: 5px;
box-sizing: border-box;
font-size: 1em;
transition: border-color 0.3s ease;
}
.input-group input[type="number"]:focus,
.input-group input[type="text"]:focus,
.input-group select:focus {
border-color: var(–primary-color);
outline: none;
box-shadow: 0 0 0 3px rgba(0, 74, 153, 0.2);
}
.input-group .helper-text {
font-size: 0.85em;
color: #6c757d;
margin-top: 5px;
}
.input-group .error-message {
color: var(–error-color);
font-size: 0.85em;
margin-top: 5px;
min-height: 1.2em; /* Prevent layout shift */
}
.button-group {
display: flex;
justify-content: space-between;
margin-top: 25px;
gap: 10px;
}
.button-group button {
padding: 12px 20px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 1em;
font-weight: 600;
transition: background-color 0.3s ease, transform 0.2s ease;
flex: 1;
}
.button-group button.primary {
background-color: var(–primary-color);
color: white;
}
.button-group button.primary:hover {
background-color: #003366;
transform: translateY(-2px);
}
.button-group button.secondary {
background-color: #6c757d;
color: white;
}
.button-group button.secondary:hover {
background-color: #5a6268;
transform: translateY(-2px);
}
.results-container {
margin-top: 30px;
padding: 25px;
border: 1px solid var(–border-color);
border-radius: 8px;
background-color: var(–card-background);
text-align: center;
}
.results-container h3 {
color: var(–primary-color);
margin-top: 0;
font-size: 1.6em;
margin-bottom: 20px;
}
.main-result {
font-size: 2.2em;
font-weight: 700;
color: var(–success-color);
margin-bottom: 15px;
padding: 15px;
background-color: #e9f7ef;
border-radius: 5px;
display: inline-block;
min-width: 200px;
}
.intermediate-results div {
margin-bottom: 10px;
font-size: 1.1em;
}
.intermediate-results span {
font-weight: 600;
color: var(–primary-color);
}
.formula-explanation {
font-size: 0.9em;
color: #6c757d;
margin-top: 15px;
border-top: 1px dashed var(–border-color);
padding-top: 15px;
}
.chart-container {
margin-top: 30px;
padding: 25px;
border: 1px solid var(–border-color);
border-radius: 8px;
background-color: var(–card-background);
text-align: center;
}
.chart-container h3 {
color: var(–primary-color);
margin-top: 0;
font-size: 1.6em;
margin-bottom: 20px;
}
canvas {
max-width: 100%;
height: auto !important; /* Ensure canvas scales properly */
}
.table-container {
margin-top: 30px;
padding: 25px;
border: 1px solid var(–border-color);
border-radius: 8px;
background-color: var(–card-background);
text-align: center;
overflow-x: auto; /* For responsiveness */
}
.table-container h3 {
color: var(–primary-color);
margin-top: 0;
font-size: 1.6em;
margin-bottom: 20px;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 15px;
}
th, td {
padding: 12px 15px;
text-align: left;
border-bottom: 1px solid var(–border-color);
}
thead th {
background-color: var(–primary-color);
color: white;
font-weight: 700;
}
tbody tr:nth-child(even) {
background-color: #f2f2f2;
}
tbody td {
font-size: 0.95em;
}
.section-title {
font-size: 2em;
color: var(–primary-color);
margin-top: 40px;
margin-bottom: 20px;
border-bottom: 2px solid var(–primary-color);
padding-bottom: 10px;
font-weight: 700;
}
.article-content {
background-color: var(–card-background);
padding: 30px;
border-radius: 8px;
box-shadow: 0 4px 15px var(–shadow-color);
margin-bottom: 30px;
text-align: left;
}
.article-content h2 {
font-size: 1.8em;
color: var(–primary-color);
margin-top: 30px;
margin-bottom: 15px;
font-weight: 700;
}
.article-content h3 {
font-size: 1.4em;
color: var(–primary-color);
margin-top: 25px;
margin-bottom: 10px;
font-weight: 600;
}
.article-content p {
margin-bottom: 15px;
}
.article-content ul, .article-content ol {
margin-left: 20px;
margin-bottom: 15px;
}
.article-content li {
margin-bottom: 8px;
}
.article-content strong {
color: var(–primary-color);
}
.faq-item {
margin-bottom: 20px;
padding: 15px;
border: 1px solid var(–border-color);
border-radius: 5px;
background-color: #fefefe;
}
.faq-item h4 {
margin: 0 0 10px 0;
color: var(–primary-color);
font-size: 1.1em;
cursor: pointer;
position: relative;
padding-left: 25px;
}
.faq-item h4::before {
content: '+';
position: absolute;
left: 0;
font-weight: bold;
color: var(–primary-color);
font-size: 1.2em;
top: 50%;
transform: translateY(-50%);
}
.faq-item.active h4::before {
content: '-';
}
.faq-item .answer {
display: none;
margin-top: 10px;
font-size: 0.95em;
color: #555;
}
.internal-links {
margin-top: 30px;
padding: 25px;
border: 1px solid var(–border-color);
border-radius: 8px;
background-color: var(–card-background);
}
.internal-links h3 {
color: var(–primary-color);
margin-top: 0;
font-size: 1.6em;
margin-bottom: 20px;
}
.internal-links ul {
list-style: none;
padding: 0;
margin: 0;
}
.internal-links li {
margin-bottom: 15px;
}
.internal-links a {
color: var(–primary-color);
text-decoration: none;
font-weight: 600;
transition: color 0.3s ease;
}
.internal-links a:hover {
color: #003366;
text-decoration: underline;
}
.internal-links p {
font-size: 0.9em;
color: #6c757d;
margin-top: 5px;
}
footer {
text-align: center;
padding: 20px;
margin-top: 40px;
width: 100%;
background-color: var(–primary-color);
color: white;
font-size: 0.9em;
}
@media (min-width: 768px) {
.button-group {
justify-content: flex-end;
}
.button-group button {
flex: unset;
width: auto;
}
}
Estimated Closing Costs Summary
Total Closing Costs = (Loan Origination Fee + Appraisal Fee + Title Search & Insurance + Recording Fees + Survey Fee + Attorney Fees + Pest Inspection Fee + Escrow Setup Fee) + Prepaid Interest + Property Tax Proration + Homeowners Insurance Proration + Down Payment.
Closing Cost Breakdown
Detailed Closing Cost Table
| Category |
Estimated Cost ($) |
What is a Georgia Closing Cost Calculator?
A Georgia closing cost calculator is an online tool designed to help prospective homebuyers and sellers in Georgia estimate the various fees and expenses they will incur at the end of a real estate transaction. Closing costs are a collection of fees charged by lenders, title companies, government agencies, and other third parties involved in finalizing a property sale. These costs are separate from the down payment and the purchase price itself. Understanding these expenses upfront is crucial for budgeting and avoiding financial surprises during the home buying or selling process in Georgia.
Who should use it?
- Prospective Homebuyers: To accurately budget for the total cost of purchasing a home, beyond the down payment and mortgage principal. This includes understanding lender fees, title insurance, prepaid items, and prorations.
- Home Sellers: While primarily focused on buyer costs, sellers also have closing costs (e.g., real estate agent commissions, transfer taxes, attorney fees). This calculator can help buyers estimate their side, indirectly informing seller negotiations.
- Real Estate Agents and Mortgage Brokers: To provide clients with reliable estimates and enhance their service offerings.
- Financial Planners: To assist clients in planning their real estate investments.
Common Misconceptions:
- Closing costs are fixed: While some fees are standard, many vary based on the lender, title company, location within Georgia, and the specific terms of the transaction.
- Closing costs are only for buyers: Sellers also incur costs, such as agent commissions, transfer taxes, and attorney fees.
- The calculator provides an exact figure: This tool offers an estimate. Actual costs may differ slightly. It's always best to get a formal Loan Estimate from your lender.
- All fees are paid at closing: Some costs, like property taxes and homeowners insurance, are often paid in advance (prorated or for the first year) at closing.
The Georgia closing cost calculator aggregates various fees and prepaid items to provide a total estimated closing cost. The calculation involves several components, each derived from specific inputs.
Step-by-Step Derivation:
- Loan Origination Fees: Calculated as a percentage of the loan amount.
- Prepaid Interest: Calculated based on the daily interest rate multiplied by the number of prepaid interest days.
- Property Tax Proration: Calculated based on the annual property tax, divided by 365 days, then multiplied by the number of days in the current tax period that the buyer will be responsible for. This is often simplified in calculators to a prorated amount based on the closing date within the tax year. For simplicity, we calculate the seller's portion to be credited to the buyer.
- Homeowners Insurance Proration: Calculated similarly to property taxes, based on the annual premium and the remaining term covered by the seller.
- Total Closing Costs: Sum of all individual fees (lender fees, title fees, government fees, etc.) plus prepaid items and prorated amounts.
Variable Explanations:
| Variable |
Meaning |
Unit |
Typical Range (Georgia) |
| Purchase Price |
The agreed-upon price for the property. |
$ |
$150,000 – $1,000,000+ |
| Loan Amount |
The total amount borrowed from the lender. |
$ |
$100,000 – $800,000+ |
| Down Payment |
The cash amount paid upfront by the buyer. |
$ |
3% – 20%+ of Purchase Price |
| Annual Property Taxes |
Estimated yearly property tax bill. |
$ |
0.8% – 1.5%+ of Purchase Price |
| Annual Homeowners Insurance |
Estimated yearly insurance premium. |
$ |
$600 – $2,500+ |
| Lender Origination Fee (%) |
Fee charged by the lender for processing the loan. |
% of Loan Amount |
0.5% – 1.5% |
| Appraisal Fee |
Cost for the property valuation. |
$ |
$400 – $700 |
| Title Search & Insurance Fee |
Cost for title examination and insurance policies. |
$ |
$1,000 – $3,000+ |
| Recording Fees |
Fees paid to the county to record the deed and mortgage. |
$ |
$100 – $300 |
| Survey Fee |
Cost for a property boundary survey. |
$ |
$300 – $600 |
| Attorney Fees |
Fees for legal services related to the closing. |
$ |
$800 – $1,500+ |
| Pest Inspection Fee |
Cost for a termite inspection. |
$ |
$100 – $200 |
| Escrow Setup Fee |
Fee for establishing the escrow account for taxes/insurance. |
$ |
$150 – $400 |
| Prepaid Interest Days |
Number of days interest paid at closing. |
Days |
15 – 30 |
| Property Tax Proration Days |
Seller's credit for prepaid taxes. |
Days |
Variable (based on closing date) |
| Homeowners Insurance Proration Days |
Seller's credit for prepaid insurance. |
Days |
Variable (based on closing date) |
Practical Examples (Real-World Use Cases)
Let's illustrate with two common scenarios for purchasing a home in Georgia:
Example 1: First-Time Homebuyer in Atlanta
Scenario: A buyer is purchasing a condo in Atlanta for $350,000 with a 10% down payment ($35,000). They secure a loan for $315,000. Their estimated annual property taxes are $4,200 (1.2% of price), and annual homeowners insurance is $900. Lender origination fee is 1%, appraisal is $500, title/search is $1,800, recording fees $200, survey $0 (condo), attorney fees $1,200, pest inspection $150, escrow setup $300. They close on July 15th, paying 15 days of prepaid interest. Property taxes are paid annually in arrears, and the seller has paid through June 30th. Homeowners insurance is paid annually, and the seller has paid through June 30th.
Inputs:
- Purchase Price: $350,000
- Loan Amount: $315,000
- Down Payment: $35,000
- Annual Property Taxes: $4,200
- Annual Homeowners Insurance: $900
- Lender Origination Fee: 1% ($3,150)
- Appraisal Fee: $500
- Title Search & Insurance: $1,800
- Recording Fees: $200
- Survey Fee: $0
- Attorney Fees: $1,200
- Pest Inspection Fee: $150
- Escrow Setup Fee: $300
- Prepaid Interest Days: 15
- Property Tax Proration Days: Seller paid through June 30th (Buyer pays for July 1st – Dec 31st = 168 days). Seller credit = ($4200/365) * 168 = $1,935.62
- Homeowners Insurance Proration Days: Seller paid through June 30th (Buyer pays for July 1st – June 30th of next year = 365 days). Seller credit = ($900/365) * 365 = $900. (Note: Often buyer pays full year premium upfront, seller credits unused portion). Let's assume seller credit for remaining term. If policy renews June 30th, seller credit is $0. If policy is annual and paid, seller credits remaining months. For simplicity, let's assume seller credit for remaining 168 days of the current policy term: ($900/365) * 168 = $414.79
Calculations:
- Loan Origination Fee: $315,000 * 0.01 = $3,150
- Prepaid Interest: ($315,000 * (0.06 / 365)) * 15 days ≈ $1,293.15 (Assuming 6% interest rate)
- Property Tax Proration (Seller Credit): $1,935.62
- Homeowners Insurance Proration (Seller Credit): $414.79
- Sum of Other Fees: $500 + $1800 + $200 + $0 + $1200 + $150 + $300 = $4,150
- Total Estimated Closing Costs (Buyer): $3,150 (Loan Fee) + $1,293.15 (Prepaid Interest) + $1,935.62 (Tax Proration) + $414.79 (Insurance Proration) + $4,150 (Other Fees) = $10,943.56
Interpretation: The buyer should expect to bring approximately $10,944 to closing, in addition to their $35,000 down payment. This covers lender fees, prepaid interest, prorated taxes and insurance, and other miscellaneous costs.
Example 2: Move-Up Buyer in Savannah
Scenario: A buyer is purchasing a larger home in Savannah for $550,000, putting down $110,000 (20%) to avoid PMI. Loan amount is $440,000. Annual property taxes are $6,600 (1.2%), and annual homeowners insurance is $1,500. Lender origination fee is 0.75%, appraisal $600, title/search $2,500, recording fees $250, survey $500, attorney fees $1,400, pest inspection $175, escrow setup $350. Closing occurs on March 10th, paying 20 days of prepaid interest. Property taxes are paid quarterly, and the seller has paid through March 31st. Homeowners insurance is paid annually, and the seller has paid through March 31st.
Inputs:
- Purchase Price: $550,000
- Loan Amount: $440,000
- Down Payment: $110,000
- Annual Property Taxes: $6,600
- Annual Homeowners Insurance: $1,500
- Lender Origination Fee: 0.75% ($3,300)
- Appraisal Fee: $600
- Title Search & Insurance: $2,500
- Recording Fees: $250
- Survey Fee: $500
- Attorney Fees: $1,400
- Pest Inspection Fee: $175
- Escrow Setup Fee: $350
- Prepaid Interest Days: 20
- Property Tax Proration Days: Seller paid through March 31st (Buyer pays for April 1st – Dec 31st = 275 days). Seller credit = ($6600/365) * 275 = $4,958.90
- Homeowners Insurance Proration Days: Seller paid through March 31st (Buyer pays for April 1st – March 31st of next year = 365 days). Seller credit = ($1500/365) * 365 = $1,500. (Assuming seller credit for remaining term).
Calculations:
- Loan Origination Fee: $440,000 * 0.0075 = $3,300
- Prepaid Interest: ($440,000 * (0.065 / 365)) * 20 days ≈ $1,564.38 (Assuming 6.5% interest rate)
- Property Tax Proration (Seller Credit): $4,958.90
- Homeowners Insurance Proration (Seller Credit): $1,500.00
- Sum of Other Fees: $600 + $2500 + $250 + $500 + $1400 + $175 + $350 = $5,775
- Total Estimated Closing Costs (Buyer): $3,300 (Loan Fee) + $1,564.38 (Prepaid Interest) + $4,958.90 (Tax Proration) + $1,500.00 (Insurance Proration) + $5,775 (Other Fees) = $17,198.28
Interpretation: This buyer needs to bring approximately $17,198 to closing, in addition to their substantial $110,000 down payment. The higher purchase price and loan amount naturally lead to higher closing costs, even with a lower origination fee percentage.
How to Use This Georgia Closing Cost Calculator
Using the Georgia closing cost calculator is straightforward. Follow these steps to get your estimated closing costs:
- Enter Property Details: Input the agreed-upon Purchase Price and your Loan Amount. If you know your exact down payment, enter that; otherwise, it will be calculated based on the price and loan amount.
- Input Annual Costs: Provide your estimated Annual Property Taxes and Annual Homeowners Insurance premiums. If unsure, consult recent tax records or get quotes.
- Specify Lender Fees: Enter the Lender Origination Fee as a percentage, and the fixed costs for Appraisal Fee.
- Add Title and Third-Party Fees: Input estimates for Title Search & Insurance, Recording Fees, Survey Fee (if applicable), Attorney Fees, Pest Inspection Fee, and Escrow Setup Fee. These can often be obtained from your real estate agent or lender.
- Enter Proration Details: Specify the number of Prepaid Interest Days (usually 15-30), and the relevant Property Tax Proration Days and Homeowners Insurance Proration Days based on your closing date and when the seller last paid these bills.
- Calculate: Click the "Calculate Costs" button.
- Review Results: The calculator will display the Total Estimated Closing Costs prominently, along with key intermediate values like loan fees, prepaid items, and other fees. A breakdown table and a chart will visually represent the cost distribution.
- Use the "Copy Results" Button: Easily copy all calculated figures and assumptions for your records or to share with your lender or agent.
- Reset: Use the "Reset" button to clear all fields and start over with default values.
How to Read Results:
- Main Result (Total Estimated Closing Costs): This is the primary figure you need to budget for. It represents the cash you'll likely need to bring to the closing table, separate from your down payment.
- Intermediate Values: These break down the total into logical categories (Loan Fees, Prepaid Items, Other Fees), helping you understand where the money is going.
- Table and Chart: Provide a visual and detailed breakdown of each cost component, making it easier to identify the largest expenses.
Decision-Making Guidance:
- Budgeting: Use the total estimated cost to ensure you have sufficient funds saved.
- Negotiation: Understanding these costs can inform negotiations with the seller regarding closing cost credits.
- Lender Comparison: Compare the lender-specific fees (origination, points) across different loan offers.
- Shopping Around: Fees for title companies, attorneys, and inspectors can vary. Use the estimates as a baseline to compare quotes from different providers.
Key Factors That Affect Georgia Closing Costs
Several factors influence the final amount of closing costs in Georgia. Understanding these can help you anticipate variations:
- Loan Type and Lender: FHA, VA, and conventional loans have different fee structures. Lenders also vary significantly in their origination fees, processing fees, and other charges. Shopping for the best mortgage rates and terms is crucial.
- Purchase Price and Loan Amount: Many closing costs are calculated as a percentage of the purchase price or loan amount (e.g., origination fees, title insurance premiums, transfer taxes). Higher prices generally mean higher costs.
- Down Payment Size: A larger down payment reduces the loan amount, which can lower costs tied to the loan size, such as origination fees. It also impacts lender fees and potentially private mortgage insurance (PMI).
- Location within Georgia: Specific county and city recording fees, transfer taxes (like the Georgia Real Estate Transfer Tax), and local government charges can differ across municipalities.
- Property Taxes and Homeowners Insurance: The annual amounts for these directly impact the prorated amounts due at closing. Higher tax rates or insurance premiums will increase the prepaid or prorated portions.
- Negotiations and Seller Concessions: Buyers can negotiate for sellers to cover a portion of the closing costs. The final amount paid by the buyer can be significantly reduced through such agreements.
- Title Company and Attorney Choice: Fees for title searches, title insurance, and legal services can vary between providers. Comparing quotes can lead to savings.
- Home Inspection and Appraisal Requirements: While often standard, the specific costs for these services can fluctuate based on the provider and the complexity of the property.
- Survey Needs: Some properties, especially larger or rural ones, require a survey, adding to the closing costs.
- Escrow Account Funding: At closing, you'll typically fund an escrow account with several months' worth of property taxes and homeowners insurance premiums. This is a significant upfront cost, though it covers future payments.
Frequently Asked Questions (FAQ)
What is the typical percentage of closing costs in Georgia?
In Georgia, closing costs for buyers typically range from 2% to 5% of the loan amount, excluding the down payment. This can vary based on the loan type, lender fees, and other factors. For a $300,000 loan, this could mean $6,000 to $15,000 in closing costs.
Are closing costs tax-deductible in Georgia?
Some closing costs might be deductible, but it depends on the specifics. Costs like mortgage interest paid at closing, points paid to obtain the loan, and property taxes paid at closing are generally deductible. Fees for services like appraisals, title insurance, and legal work are typically not deductible but may be added to the home's cost basis. Consult a tax professional for personalized advice.
Who pays for closing costs in Georgia?
Typically, the buyer pays the majority of the closing costs. However, sellers also have their own closing costs, primarily real estate agent commissions, transfer taxes, and potentially some attorney fees. Buyers and sellers can negotiate who pays for specific costs, often resulting in seller concessions towards the buyer's closing costs.
What is included in the Georgia Real Estate Transfer Tax?
The Georgia Real Estate Transfer Tax is levied on the transfer of property ownership. The state rate is $1 per $1,000 of value (0.1%). Additionally, counties and municipalities may impose their own transfer taxes, often ranging from $0.10 to $1.10 per $100 of value (1% to 1.1%). This tax is typically paid by the seller, but it can be negotiated.
How much should I budget for an escrow account deposit?
At closing, lenders usually require you to fund an escrow account with enough money to cover property taxes and homeowners insurance for the next few months. This often includes 2-6 months of each expense, plus the prorated amount from the closing date. For example, if your monthly tax/insurance escrow is $300, you might need to deposit $600-$1,800 plus prorations.
Can I negotiate closing costs in Georgia?
Yes, absolutely. Buyers can negotiate with sellers to cover some or all of their closing costs. This is common, especially in competitive markets or if the property needs repairs. You can also shop around for different lenders, title companies, and attorneys to find better rates on specific fees.
What is the difference between closing costs and a down payment?
The down payment is the initial cash payment made towards the purchase price of the home, reducing the amount you need to borrow. Closing costs are separate fees paid at the end of the transaction to finalize the sale and transfer ownership. They cover services and taxes related to the mortgage and property transfer.
How does the closing date affect prorated costs?
The closing date is critical for prorated expenses like property taxes and homeowners insurance. The seller is responsible for these costs up to the closing date, and the buyer is responsible from the closing date onward. The closing statement (HUD-1 or Closing Disclosure) will show credits from the seller to the buyer for the portion of expenses the seller prepaid beyond the closing date.
What is the role of an attorney in Georgia closings?
In Georgia, a real estate attorney is typically required to conduct the title search, prepare closing documents, and oversee the closing process. They ensure the title is clear, all legal requirements are met, and funds are properly disbursed, providing a crucial layer of legal protection for both buyer and seller.
Related Tools and Internal Resources
var chartInstance = null; // Global variable to hold chart instance
function getElement(id) {
return document.getElementById(id);
}
function validateInput(value, id, min, max, message) {
var errorElement = getElement(id + "Error");
errorElement.textContent = ""; // Clear previous error
if (value === "") {
errorElement.textContent = "This field cannot be empty.";
return false;
}
var numValue = parseFloat(value);
if (isNaN(numValue)) {
errorElement.textContent = "Please enter a valid number.";
return false;
}
if (min !== undefined && numValue max) {
errorElement.textContent = message || `Value cannot exceed ${max}.`;
return false;
}
return true;
}
function calculateClosingCosts() {
// Get input values
var purchasePrice = getElement("purchasePrice").value;
var loanAmount = getElement("loanAmount").value;
var downPayment = getElement("downPayment").value;
var propertyTaxesAnnual = getElement("propertyTaxesAnnual").value;
var homeownersInsuranceAnnual = getElement("homeownersInsuranceAnnual").value;
var loanOriginationFeePercent = getElement("loanOriginationFeePercent").value;
var appraisalFee = getElement("appraisalFee").value;
var titleSearchFee = getElement("titleSearchFee").value;
var recordingFees = getElement("recordingFees").value;
var surveyFee = getElement("surveyFee").value;
var attorneyFees = getElement("attorneyFees").value;
var pestInspectionFee = getElement("pestInspectionFee").value;
var escrowSetupFee = getElement("escrowSetupFee").value;
var prepaidInterestDays = getElement("prepaidInterestDays").value;
var propertyTaxesProrationDays = getElement("propertyTaxesProrationDays").value;
var homeownersInsuranceProrationDays = getElement("homeownersInsuranceProrationDays").value;
// — Input Validation —
var isValid = true;
isValid &= validateInput(purchasePrice, "purchasePrice", 0, Infinity, "Purchase price must be positive.");
isValid &= validateInput(loanAmount, "loanAmount", 0, Infinity, "Loan amount must be positive.");
isValid &= validateInput(downPayment, "downPayment", 0, Infinity, "Down payment must be positive.");
isValid &= validateInput(propertyTaxesAnnual, "propertyTaxesAnnual", 0, Infinity, "Annual property taxes must be positive.");
isValid &= validateInput(homeownersInsuranceAnnual, "homeownersInsuranceAnnual", 0, Infinity, "Annual homeowners insurance must be positive.");
isValid &= validateInput(loanOriginationFeePercent, "loanOriginationFeePercent", 0, 10, "Origination fee percentage must be between 0% and 10%.");
isValid &= validateInput(appraisalFee, "appraisalFee", 0, Infinity, "Appraisal fee must be positive.");
isValid &= validateInput(titleSearchFee, "titleSearchFee", 0, Infinity, "Title search fee must be positive.");
isValid &= validateInput(recordingFees, "recordingFees", 0, Infinity, "Recording fees must be positive.");
isValid &= validateInput(surveyFee, "surveyFee", 0, Infinity, "Survey fee must be positive.");
isValid &= validateInput(attorneyFees, "attorneyFees", 0, Infinity, "Attorney fees must be positive.");
isValid &= validateInput(pestInspectionFee, "pestInspectionFee", 0, Infinity, "Pest inspection fee must be positive.");
isValid &= validateInput(escrowSetupFee, "escrowSetupFee", 0, Infinity, "Escrow setup fee must be positive.");
isValid &= validateInput(prepaidInterestDays, "prepaidInterestDays", 0, 30, "Prepaid interest days must be between 0 and 30.");
isValid &= validateInput(propertyTaxesProrationDays, "propertyTaxesProrationDays", 0, 365, "Property tax proration days must be between 0 and 365.");
isValid &= validateInput(homeownersInsuranceProrationDays, "homeownersInsuranceProrationDays", 0, 365, "Homeowners insurance proration days must be between 0 and 365.");
// Additional check: Loan Amount + Down Payment should roughly equal Purchase Price
var ppNum = parseFloat(purchasePrice);
var laNum = parseFloat(loanAmount);
var dpNum = parseFloat(downPayment);
if (Math.abs((laNum + dpNum) – ppNum) > 1000 && ppNum > 0) { // Allow a small tolerance
getElement("loanAmountError").textContent = "Loan amount + Down payment should approximate Purchase Price.";
getElement("downPaymentError").textContent = "Loan amount + Down payment should approximate Purchase Price.";
isValid = false;
}
if (!isValid) {
getElement("results-container").style.display = "none";
return;
}
// — Calculations —
var pp = parseFloat(purchasePrice);
var la = parseFloat(loanAmount);
var dp = parseFloat(downPayment);
var pt_annual = parseFloat(propertyTaxesAnnual);
var hi_annual = parseFloat(homeownersInsuranceAnnual);
var loanOriginationPercent = parseFloat(loanOriginationFeePercent);
var appFee = parseFloat(appraisalFee);
var titleFee = parseFloat(titleSearchFee);
var recFee = parseFloat(recordingFees);
var surveyFeeVal = parseFloat(surveyFee);
var attFee = parseFloat(attorneyFees);
var pestFee = parseFloat(pestInspectionFee);
var escrowFee = parseFloat(escrowSetupFee);
var prepaidIntDays = parseInt(prepaidInterestDays);
var taxProrationDays = parseInt(propertyTaxesProrationDays);
var hiProrationDays = parseInt(homeownersInsuranceProrationDays);
// Assume a sample interest rate for prepaid interest calculation if not provided
// In a real scenario, this would come from the loan details.
var assumedInterestRate = 0.065; // 6.5%
// Loan Origination Fee
var loanOriginationFee = la * (loanOriginationPercent / 100);
// Prepaid Interest
var dailyInterestRate = assumedInterestRate / 365;
var prepaidInterest = la * dailyInterestRate * prepaidIntDays;
// Property Tax Proration (Seller's credit to buyer)
// This calculation assumes the seller has paid taxes up to a certain point, and the buyer needs to cover the remainder of the tax period.
// A more precise calculation would involve knowing the exact tax period start/end dates and closing date.
// Here, we use the input days as the seller's prepaid portion.
var propertyTaxProration = (pt_annual / 365) * (365 – taxProrationDays); // Buyer pays remaining days
// Homeowners Insurance Proration (Seller's credit to buyer)
var homeownersInsuranceProration = (hi_annual / 365) * (365 – hiProrationDays); // Buyer pays remaining days
// Sum of Other Fees
var otherFeesTotal = appFee + titleFee + recFee + surveyFeeVal + attFee + pestFee + escrowFee;
// Total Closing Costs
var totalClosingCosts = loanOriginationFee + prepaidInterest + propertyTaxProration + homeownersInsuranceProration + otherFeesTotal;
// — Display Results —
getElement("totalClosingCosts").textContent = "$" + totalClosingCosts.toFixed(2);
getElement("loanFees").textContent = "Loan Fees: $" + (loanOriginationFee + prepaidInterest).toFixed(2);
getElement("prepaidItems").textContent = "Prepaid Items & Prorations: $" + (propertyTaxProration + homeownersInsuranceProration).toFixed(2);
getElement("otherFees").textContent = "Other Fees: $" + otherFeesTotal.toFixed(2);
getElement("results-container").style.display = "block";
// — Update Table —
updateTable(
loanOriginationFee,
prepaidInterest,
propertyTaxProration,
homeownersInsuranceProration,
appFee,
titleFee,
recFee,
surveyFeeVal,
attFee,
pestFee,
escrowFee
);
// — Update Chart —
updateChart(
loanOriginationFee,
prepaidInterest,
propertyTaxProration,
homeownersInsuranceProration,
otherFeesTotal // Grouping appraisal, title, recording, survey, attorney, pest, escrow
);
}
function updateTable(loanOriginationFee, prepaidInterest, propertyTaxProration, homeownersInsuranceProration, appFee, titleFee, recFee, surveyFeeVal, attFee, pestFee, escrowFee) {
var tableBody = getElement("closingCostTable").getElementsByTagName('tbody')[0];
tableBody.innerHTML = "; // Clear previous rows
var data = [
{ category: "Lender Origination Fee", cost: loanOriginationFee },
{ category: "Prepaid Interest", cost: prepaidInterest },
{ category: "Property Tax Proration (Buyer's Share)", cost: propertyTaxProration },
{ category: "Homeowners Insurance Proration (Buyer's Share)", cost: homeownersInsuranceProration },
{ category: "Appraisal Fee", cost: appFee },
{ category: "Title Search & Insurance", cost: titleFee },
{ category: "Recording Fees", cost: recFee },
{ category: "Survey Fee", cost: surveyFeeVal },
{ category: "Attorney Fees", cost: attFee },
{ category: "Pest Inspection Fee", cost: pestFee },
{ category: "Escrow Setup Fee", cost: escrowFee }
];
data.forEach(function(item) {
var row = tableBody.insertRow();
var cell1 = row.insertCell(0);
var cell2 = row.insertCell(1);
cell1.textContent = item.category;
cell2.textContent = "$" + item.cost.toFixed(2);
});
}
function updateChart(loanOriginationFee, prepaidInterest, propertyTaxProration, homeownersInsuranceProration, otherFeesTotal) {
var ctx = getElement('closingCostChart').getContext('2d');
// Destroy previous chart instance if it exists
if (chartInstance) {
chartInstance.destroy();
}
// Define chart data
var labels = ['Loan Fees', 'Prepaid Interest', 'Taxes & Insurance Prorations', 'Other Fees'];
var dataValues = [
loanOriginationFee,
prepaidInterest,
propertyTaxProration + homeownersInsuranceProration,
otherFeesTotal
];
// Define colors
var backgroundColors = [
'rgba(0, 74, 153, 0.7)', // Primary Blue
'rgba(40, 167, 69, 0.7)', // Success Green
'rgba(255, 193, 7, 0.7)', // Warning Yellow
'rgba(108, 117, 125, 0.7)' // Secondary Gray
];
var borderColors = [
'rgba(0, 74, 153, 1)',
'rgba(40, 167, 69, 1)',
'rgba(255, 193, 7, 1)',
'rgba(108, 117, 125, 1)'
];
chartInstance = new Chart(ctx, {
type: 'bar', // Use bar chart for better comparison
data: {
labels: labels,
datasets: [{
label: 'Estimated Closing Costs ($)',
data: dataValues,
backgroundColor: backgroundColors,
borderColor: borderColors,
borderWidth: 1
}]
},
options: {
responsive: true,
maintainAspectRatio: false, // Allows custom height
scales: {
y: {
beginAtZero: true,
ticks: {
callback: function(value) {
if (value % 1000 === 0) {
return '$' + (value / 1000) + 'K';
} else if (value % 500 === 0) {
return '$' + (value / 500) + 'x500';
}
return '$' + value;
}
}
}
},
plugins: {
legend: {
display: false // Hide legend as labels are on the bars
},
tooltip: {
callbacks: {
label: function(context) {
var label = context.dataset.label || ";
if (label) {
label += ': ';
}
if (context.parsed.y !== null) {
label += new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(context.parsed.y);
}
return label;
}
}
}
}
}
});
}
function resetForm() {
getElement("purchasePrice").value = "300000";
getElement("loanAmount").value = "240000";
getElement("downPayment").value = "60000";
getElement("propertyTaxesAnnual").value = "3600";
getElement("homeownersInsuranceAnnual").value = "1200";
getElement("loanOriginationFeePercent").value = "1";
getElement("appraisalFee").value = "500";
getElement("titleSearchFee").value = "1500";
getElement("recordingFees").value = "200";
getElement("surveyFee").value = "400";
getElement("attorneyFees").value = "1200";
getElement("pestInspectionFee").value = "150";
getElement("escrowSetupFee").value = "300";
getElement("prepaidInterestDays").value = "15";
getElement("propertyTaxesProrationDays").value = "180";
getElement("homeownersInsuranceProrationDays").value = "365";
// Clear errors
var errorElements = document.querySelectorAll('.error-message');
for (var i = 0; i < errorElements.length; i++) {
errorElements[i].textContent = "";
}
getElement("results-container").style.display = "none";
if (chartInstance) {
chartInstance.destroy();
chartInstance = null;
}
// Clear table
var tableBody = getElement("closingCostTable").getElementsByTagName('tbody')[0];
tableBody.innerHTML = '';
}
function copyResults() {
var totalCosts = getElement("totalClosingCosts").textContent;
var loanFees = getElement("loanFees").textContent;
var prepaidItems = getElement("prepaidItems").textContent;
var otherFees = getElement("otherFees").textContent;
var formula = document.querySelector('.formula-explanation').textContent;
var assumptions = "Key Assumptions:\n";
assumptions += "Purchase Price: $" + getElement("purchasePrice").value + "\n";
assumptions += "Loan Amount: $" + getElement("loanAmount").value + "\n";
assumptions += "Down Payment: $" + getElement("downPayment").value + "\n";
assumptions += "Annual Property Taxes: $" + getElement("propertyTaxesAnnual").value + "\n";
assumptions += "Annual Homeowners Insurance: $" + getElement("homeownersInsuranceAnnual").value + "\n";
assumptions += "Lender Origination Fee: " + getElement("loanOriginationFeePercent").value + "%\n";
assumptions += "Appraisal Fee: $" + getElement("appraisalFee").value + "\n";
assumptions += "Title Search & Insurance: $" + getElement("titleSearchFee").value + "\n";
assumptions += "Recording Fees: $" + getElement("recordingFees").value + "\n";
assumptions += "Survey Fee: $" + getElement("surveyFee").value + "\n";
assumptions += "Attorney Fees: $" + getElement("attorneyFees").value + "\n";
assumptions += "Pest Inspection Fee: $" + getElement("pestInspectionFee").value + "\n";
assumptions += "Escrow Setup Fee: $" + getElement("escrowSetupFee").value + "\n";
assumptions += "Prepaid Interest Days: " + getElement("prepaidInterestDays").value + "\n";
assumptions += "Property Tax Proration Days: " + getElement("propertyTaxesProrationDays").value + "\n";
assumptions += "Homeowners Insurance Proration Days: " + getElement("homeownersInsuranceProrationDays").value + "\n";
var textToCopy = "— Georgia Closing Cost Estimate —\n\n";
textToCopy += "Total Estimated Closing Costs: " + totalCosts + "\n";
textToCopy += loanFees + "\n";
textToCopy += prepaidItems + "\n";
textToCopy += otherFees + "\n\n";
textToCopy += "Formula: " + formula + "\n\n";
textToCopy += assumptions;
// Use a temporary textarea to copy text
var textArea = document.createElement("textarea");
textArea.value = textToCopy;
textArea.style.position = "fixed"; // Avoid scrolling to bottom
textArea.style.opacity = "0";
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
try {
var successful = document.execCommand('copy');
var msg = successful ? 'Results copied successfully!' : 'Failed to copy results.';
// Optionally display a temporary message to the user
console.log(msg);
// Add a temporary success message element
var copyMessage = document.createElement('div');
copyMessage.textContent = msg;
copyMessage.style.cssText = 'position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background-color: var(–success-color); color: white; padding: 15px; border-radius: 5px; z-index: 1000; font-size: 1.2em;';
document.body.appendChild(copyMessage);
setTimeout(function() {
copyMessage.remove();
}, 3000);
} catch (err) {
console.error('Fallback: Oops, unable to copy', err);
// Add a temporary error message element
var copyMessage = document.createElement('div');
copyMessage.textContent = 'Failed to copy results. Please copy manually.';
copyMessage.style.cssText = 'position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background-color: var(–error-color); color: white; padding: 15px; border-radius: 5px; z-index: 1000; font-size: 1.2em;';
document.body.appendChild(copyMessage);
setTimeout(function() {
copyMessage.remove();
}, 3000);
}
document.body.removeChild(textArea);
}
function toggleFaq(element) {
var faqItem = element.parentElement;
faqItem.classList.toggle('active');
var answer = faqItem.querySelector('.answer');
if (faqItem.classList.contains('active')) {
answer.style.display = 'block';
} else {
answer.style.display = 'none';
}
}
// Initial calculation on page load if default values are set
document.addEventListener('DOMContentLoaded', function() {
calculateClosingCosts();
// Add event listeners for real-time updates
var inputs = document.querySelectorAll('#calculator-form input, #calculator-form select');
for (var i = 0; i < inputs.length; i++) {
inputs[i].addEventListener('input', calculateClosingCosts);
}
});
// Load Chart.js library dynamically if not already present
// This is a common practice but requires ensuring the library is accessible.
// For a single-file HTML, it's often better to include it directly in the
// or use a CDN link. Assuming Chart.js is available globally.
// If not, you'd need to add:
//
// in the section.