The question is the total absurd. You cannot "convert" Devanagari to "hex", and "hex" to Devanagari simply because Devanagari is not encoding, and "hex" is not encoding. By the same reason, you cannot "convert" either of that to Unicode of else. They are not any data of file formats, or something like that.—SA
Moreover, even Unicode is not encoding, but different Unicode UTFs are. In other words, there is more than one way to write some characters in Unicode; but all of the ways are equivalent.
Not that this is possible or, not, the whole idea makes no sense.
First, you need to learn some very, very basic notions of computing. I don't even clearly understand what do you miss, but something very basic. Then you need to learn what Unicode is. Just read on the topic. And this can be very difficult, because I'm afraid you don't understand what is "text", "binary", etc. Probably, by "hex" you mean text presentation where each code point is expressed as a word of a number of hexadecimal digits, that is, characters. But, as I say, it depends on what UTF is this. You should understand what you want and why, and then ask a correct question.
And, by the way, I see absolutely no practical reason of transcoding Unicode text in some UTF (better be UTF-8) into anything else. However, if you do it for the purpose of learning — my respect. In this case, you will see everything as a result of your experiments.