British spelling in TOEFL writing

Is it okay write use British words in TOEFL.Are those words counted as typos?
Issue is not with the common words we all know,ex. color or favorite.
Problem arises when I don’t know that the word I am using differs in american and british locale.I used “judgemet” in essay and google doc showed it to be wrong as document is set to american English.
Does it matter in TOEFL?

Yes, mate, it’s generally fine to use British words in the TOEFL exam.

You can fix Google Docs to spell-check in en-GB. Also “judgemet” is not correct en-GB spelling either.

For the record, I used en-GB/IN when I did my TOEFL and got a 28 on the writing.

Would you like to suggest some tips?
How did you managed to obtain that high score?

Back then (in 2017), I just used official ETS resources, and did all the official practice tests I could at that time. Note that those were on a CD (i.e, offline), and didn’t provide automated scoring for the writing section.

Hope ,you won’t mind me asking,what was your total score?
My average score is about 95…struggling with speaking section (22-24).
can I expect to obtain similar in real toefl?

Back then I got 28/29/22/28 on Reading/Listening/Speaking/Writing respectively.