alright or all right?

I'm alright, thanks.
I'm all right, thanks.

1. Which do you use?
2. Are they both correct?
3. Is there one that is used in formal writing?
4. Or is one of these incorrect?

They're both correct. But some people insist that 'all right' is the correct version.

I'm alright/all right, thanks.
Basically 'alright/all right' means I'm OK/I'm fine/I'm alright

It also means 'good enough' - Is everything all right/alright?
It means 'safe and well': I hope the children are all right/alright.
Do you feel all right/alright?
"Can you get me some stamps?" "Yes, all right./ Yes, alright."

According to the Oxford Dictionary: "There is no logical reason for insisting that 'all right' should be written as two words rather than as 'alright', when other single-word forms such as 'altogether' and 'already' have long been accepted. Nevertheless, alright is still regarded as being unacceptable in formal writing."

Fowler's Modern English Usage says "That there are various arguments in its [alright] favour especially when we need 'all' and 'right' has two separate words as in, He finished the crossword and got it all right.

So remember we can use 'all right' as two separate words when everything is all correct
Your answers are all right/all correct. Though we'd probably use 'all correct' in this situation.

So use 'all right' when you're writing formally for business, in job applications and academically.
And use 'alright' in informal writing with friends, colleagues etc.