In the above sentences, ずに and ないで(naide) are interchangeable. However, in the following sentences, ないで must be used, because ずに is grammatically incorrect.
まだ帰らないでください。 ― mada kaeranaide kudasai. ― Please don’t go home yet.
電話しないで欲しい。 ― denwashinaide hoshī. ― Lit. I want you not to call me. (Fig. Don’t call me.)
見ないでください。 ― minaide kudasai. ― Please do not look at it.
ずに has the exact same formation as ないで in almost all cases. The sole exception is the verb する(suru), which changes from しないで(shinaide) to せずに(sezuni).
The difference between ないで and ずに is that ないで is used in informal speech or conversational Japanese, whereas ずに is used in formal speech or written Japanese.
For the following sentences in which the ないで clause indicates some cause for human emotion that is expressed in the main clause, なくて(nakute) can replace ないで, but not ずに.
僕は英語が話せないで恥ずかしかった。 ― boku wa eigo ga hanasenaide hazukashikatta. ― I felt ashamed because I couldn’t speak English.
スージーが遊びに来ないでほっとした。 ― sūjī ga asobi ni konaide hottoshita. ― I felt relieved because Susie didn’t come to play.
For sentences that express the idea of “X is not Y but X,” neither ないで nor ずに can replace なくて.
私は学生ではなくて先生です。 ― watashi wa gakuseide wa nakute sensei desu. ― I am not a student but a teacher.[1]
^ Makino, Seiichi, Tsutsui, Michio (1989 January 1) “Main Entries: -nai de”, in A Dictionary of Basic Japanese Grammar, 1st edition, 5-4, Shibaura 4-chome, Minato-ku, Tokyo 108-0023, Japan: The Japan Times, →ISBN, pages 271-273