How to convert String to HEX

Help me
I want to Conevert String to HEX
Ex. I send FF from Serial monitor

It's show output FF in HEX
and Show binary convert 11111111

Sorry my english not strenght

Read Robin’s post on How to use Serial

You will see good advice in there and examples parsing the input

Basically what you want to do is

IF something is in the serial line
Read that character C
IF C is a digit or letter in between A and F or a and f
IF This is the first byte received set byte variable c_high to the right numerical value between 0 and 15 else set byte result = (c_high << 4) + the right numerical value between 0 and 15 of C

Then if you type FF, the first F sets c_high to 15 so 00001111 and the second creates result as being the first byte shifted left by 4 bits, so 00001111 becomes 11110000 (so becomes the high part of the bits in your result) and when you add the second received char F is 15, so 00001111 you get

Result = 11110000 + 00001111 = 11111111

Which is what you want.

If you Serial.print(result, HEX); you will see FF
If you Serial.print(result,BIN); you will see 11111111

If you want more than one byte, have an array and fill it up