They work interchangeably and neither is formal or informal but there is slight difference in usage.
"Hallå" would more commonly be used to call for someone's attention, answering a call, or trying to get confirmation that someone can hear you, whereas "Hej" is more purely a greeting. They both mean hello, but the difference is more like that between "Hey" and "Hi". Don't worry about it too much.
For example, a phone conversation might start:
Hallå, det är Stefan, Hello, it's Stefan.
Hej, det är Sara här, hur står det till? Hey, it's Sara here, how are you?
Hej Sara, det är bra, hur är det själv? Hi Sara, I'm good, how are you?
To start with, you can think of "hej" as "hello" (greeting) and "hallå" as "hey" (calling attention). "Hallå" is standard to use on the phone. Informally, you can also use "hallå" as a greeting word when you meet a person you know well.
Hej, hallå, tjo, hejsan (and a couple of others) can be used interchangeably for "hello" as a greeting. I use "Hallå" or "Halloj" alot myself when meeting someone for the first time that day.
It's not ONLY used on the phone. The words are mostly synonymous, but there is a slight difference. I honestly wouldn't worry about it too much for now. Say whichever one.
I'm not completely sure, but my native language is Danish and we only use the word "hallo" on the phone.
No. Though the whole "ja, hallå!" isn't used much at all nowadays ("Hallå!" is frequently used in many situations).
The sound on this one is so strange! The "ja, hallå" sounds more like "ja, halu--" with the end getting cut off, but the individual word mouseover sounds "fine."
Förstår inte varför man inte har med hallå i den här frågan. Om vi ska vara strikt med översättningen så ska det vara hallå och inget annat.
There's no reason to be strict here, really - and we do accept multiple translations.
Sharing quite a number of words and a bit of the basic grammar, but that's more or less the end of it in modern Swedish. Older Swedish has much more of the German grammar, and also more Germanlike words.
Swedes in general usually don't understand German unless they've learnt it in school (or heard it a lot).