the difference between "I will and... I am going to

Use of I am going to:

when something is planned or arranged.

-I am going to Spain in a few days. ( I already have my tickets)

Use of will:

when the future is not planned or you make the decision at the moment of speaking.

-I'll probably stay at home today

.................................................. .

The main differences are:

To express a PREDICTION: Will or Be going to
I think it will rain tomorrow OR
I think it's going to rain tomorrow.

To express a PRIOR PLAN: only use BE going to
(This means that you made plans in the past to do the activity)
A: Why did you buy that paint?
B: I'm going to paint my bedroom tomorrow.
(I decided to paint my bedroom yesterday and I intend on painting it tomorrow)

To express WILLINGNESS: only use Will
(The Phone is ringing)
I'll get it! (means that you are volunteering to do it)

1. Basic meanings of the forms

Most students know that “will” and “going to” are used to talk about future time in English. However, we also use the present progressive (“be” + ING) and the present simple tense. Here are the basic rules.

Will” volunteering to do something
deciding at the time of speaking to do something

“Going to” talking about something that is already decided

...............................................

When you are predicting what you think will happen in the future, you should choose the form based on how certain you are. If you're not too sure, it's fine to use “will”, but if you're nearly certain about something, it's best to use “going to”.

I think it will rain.
(I'm not sure, but it looks like it might.)

It's going to rain.
(I'm sure it's going to rain — I can see black clouds in the sky.)