Writing a mortgage calculator

Hi everyone,

I’m trying to write a mortgage calculator with some advanced features which will be specific to the Irish market. It’ll work the usual way, you fill out some numbers, hit a button and it shows you how much your payments to the bank will be each month etc.

The problem is that since I don’t know much about the specifics of Irish mortgages, I’m having a bit of trouble writing accurate functions to calculate the numbers.

As such I have a few questions I was hoping some people could answer for me here.

Firstly, what is the most common payment frequency in Ireland? Monthly? Is it even possible to get other payment frequencies such as fortnightly or semi-annually?

Secondly, I gather that the most common mortgage terms last 25, 30 or 35 years. Is it possible to get an odd numbered mortgage such as 23 years? What about 9?

Lastly (for the moment), the two inputs I ask the user for in order to work out the principal are “House Purchase Price” and “Deposit Amount”. Obviously I subtract one from the other to get the loan principal. Do you think people will expect the calculator to automatically calculate any stamp duty payable and add that on to the loan principal? I presume that this is what most people do when they go to the bank for a mortgage, tack on the tax they have to pay?

That’s all I have for the minute. Really hope someone can help me a bit.


  • Virtually all mortgages are paid monthly.
  • It is possible to take out a mortgage for an odd number of year
  • The problem with having a stamp duty element is that there are a number of exemptions which mean that some people don’t pay stamp duty when purchasing houses where others would pay (even if purchasing the same house).


Irish banks won’t generally lend you the money to pay stamp duty. That’s not to say it’s not being borrowed elsewhere (credit unions being the main culprit) but in that case it won’t feature in the mortgage calculations.

4 weekly is (think) becoming popular?

There ate a fair few friends of our doing this to squeeze in ah extra payment every year.

So this is what I’ve got so far: Mortgage Calculator

This is my first site ever and I’m basically teaching myself programming as I go along so some of it might be a bit dodgy. The maths should be correct though, I’ve checked it against other online calculators. None of the charts will work in chrome or safari, I’m working on that at the moment.

As I’ve worked through making this I’ve learned a lot about designing a site form the ground up (there was no planning phase for the current production at all) so I’m going to go back to the drawing board and start over to build the same thing except more robust and useful. I have some ideas for more advanced functionality I’ve been mulling over for a while. Also I think the styling needs a total revamp.

I’d like to continue to use this thread for feedback if that’s ok. I’d love to hear any and all suggestions or criticisms you may have. Especially with regards to functionality you might like to see implemented.

very nice, would be useful to add in an option to incorporate mortgage interest relief to show net payments for eligible borrowers


I love it. Good work. I think you should add an overpayment function,
i.e if you overpay your mortgage by x each month, then you can reduce the term by x and pay x less in interest.
BOI have one here
boi.ie/personal/borrowing/mo … yment.html

Excellent work.

Thanks for the kind words.

Do you guys think that “Interest Rate” or “Mortgage Rate” is a more appropriate name for the loan rate information input?

One other thing.

Has anyone got, or know where to find, reliable information about the rates and ceilings for mortgage interest relief prior to 2003 when it began to be deducted at source? I don’t seem to be able to find that info on the revenue website or anywhere else on the net.

I’m working on implementing MIR into the results but I’d like to make it comprehensive enough that it will correctly deal with mortgages taken out pre 2003.


i like the comparitive view - what about scenarios for LTV or e.g.

“Increase Deposit by 10%”
“Decrease Deposit by 10%”

or something like that.

even how about parameterizing the comparitive view - so i can say increase the rate by 1.5% to see what happens.

loads of stuff out there like this but would be very good to have a comprehensive one for irish market.

i like this

ronanlyons.com/2010/04/20/yo … alculator/

this sort of scenario analysis can help actually put these decisions in wider context - not sure if you want to go down that road though as prob full of baggage, assumptions etc. and could be mistaken for advice one way or other

Andrew, I’m overhauling all of the comparative view in version 2. There’ll be multiple ways to view data and I plan on paramaterizing everything.

In other news, I finally got the charts working in chrome and safari. I probably won’t fix much else though until v2 is up. That may not be for a while yet.

why are you bothering when there’s already loads on the market today??

Yes I can’t understand why google built a search engine when there were so many search engines already in existence.

Primarily because I became interested in coding websites and I needed a vehicle to practice on.

Secondly because I’m enjoying it and I find it challenging.

I don’t really mind too much if it doesn’t become wildly successful.

Ok two questions I’m having problems answering.

What happens if I make my first monthly mortgage payment on the 31st of January. The next month has no 31st?

What happens if I’m scheduled to make a payment on the 5th of November but that day is a Saturday or Sunday?

Self improvement, eh? Why can’t you just lie on the couch, drink beer, and watch “I’m a Celebrity…” like the rest of us? I s’pose you think you’re some kind of big shot?

Seriously, you’ve done a nice job on the website, particularly for an amateur. It looks like all the logic is in JavaScript (no server-side programming), is that right? Keep up the great work.

Thanks dormutag.

Most of the user interface stuff happens on the client side but the results pages are mostly dynamically generated by the server. All the calculations happen there also and then they get returned to the browser and displayed. I’m making the second version more server reliant so I can support older browsers/phones etc. Javascript and CSS will be layered onto that rather than intrinsically intertwined (I hope!).