So which one is it? 「こんにちは」 or「こんにちわ」? For Japanese language veterans this should be a no-brainer, but it's something I had to think about in the past, and it's a mistake waiting to happen for many.
If you don't know the answer off the top of your head, don't feel bad. This has actually been addressed in Japanese language books and manga, so it's a mistake natives are prone to as well.
The answer is 「こんにちは」. If you want to know how to remember this for good, read on.
In Japanese, the character 「は」can be read, depending on the case, as either "ha" or "wa." 「わ」, on the other hand, is always "wa."
Early on in our Japanese "careers," we learn that 「は」 is a subject marker (though it really isn't). More accurately, it's a topic marker. It lets the listener/reader know what we're talking about. Now Japanese is a highly contextual language, but even in English we use fragments and drop out words all the time. That's because we often can tell what the speaker means.
"Hey, how're you?"
We're able to use "one-word" questions like this because the rest of the sentence is understood.
"Good. (And how are) You?"
We can do the same thing in Japanese.
Essentially the same conversation, but we tack a 「は」onto the topic (Joe, in this case).
こんにちは is the same deal. 「こんにちは」 = 「今日は」。Literally "Today." Extending that forward a bit, it's a shortened version of something like 「今日はいい日ですね。」(Today's a good day, isn't it?).
In this way you can think of 「こんにちは」 as something like "g'day." 「今晩は」 (こんばんは) is the same thing.
Similar story with 「左様なら」 (さようなら; Sayonara), actually. It's kind of short for "Well then (I guess that's it)."