The correct Japanese phrase for “What is it?” is “Nani desu ka?” (何ですか?) The phrase “Nan desu ka?” (なんですか?) is also commonly used, but it is a more casual and colloquial form of the question.

Both “nani” and “nan” mean “what” in Japanese, but “nani” is considered the more formal and polite form of the word. “Nan,” on the other hand, is more commonly used in casual conversation and is often used in place of “nani” in spoken language.
The use of “nani” versus “nan” can depend on several factors, including the formality of the situation, the relationship between the speakers, and the regional dialect. In formal situations, such as business meetings or academic settings, it is generally more appropriate to use “nani” to convey respect and politeness. In informal situations, such as among friends or family, either “nani” or “nan” can be used depending on the situation and the relationship between the speakers.
It is worth noting that the Japanese language has many levels of formality and politeness, and the choice of words and expressions can be nuanced and complex. In addition to “nani” and “nan,” there are many other variations and expressions for asking “what is it?” depending on the context and the level of politeness required.
In summary, “Nani desu ka?” is the correct and more formal phrase for “What is it?” in Japanese. “Nan desu ka?” is also commonly used but is considered more casual and colloquial. The choice between “nani” and “nan” can depend on several factors, including the formality of the situation and the relationship between the speakers.