A virtual teacher who reveals to you the great secrets of Base64

Base64 to Hex

The “Base64 to Hex” converter is a free tool which is able to convert online Base64 strings to Hex values. The conversion process is quite simple: the converter decodes the Base64 into the original data, then encodes it to Hex value and gives you the final result almost instantly. If you are looking for the reverse process, check Hex to Base64.


How to convert Base64 to Hex

  1. Type or paste your Base64 value into the “Base64” field.
  2. Select the desired letter case for the hex value.
  3. Limit the output length if you need to extract a certain number of bytes.
  4. Specify a delimiter to separate hex digits.
  5. Press the “Convert Base64 to Hex” button.
  6. Download or copy the result from the “Hex” field.
Comments (12)

I hope you enjoy this discussion. In any case, I ask you to join it.

  • Frank,
    Hi,

    Can I to have got code of fecode base64 to hex in javascript.

    Thank you
    • hifrankwassup,
      Ok frank here

      function base64ToHex(str) {
        const raw = atob(str);
        let result = '';
        for (let i = 0; i < raw.length; i++) {
          const hex = raw.charCodeAt(i).toString(16);
          result += (hex.length === 2 ? hex : '0' + hex);
        }
        return result.toUpperCase();
      }

      console.log(base64ToHex("oAAABTUAAg=="));


      found it on stackoverflow
      • Martin,
        Hi Frank

        Thanks for the code. I would like to implement this in a google sheet. We are forwarding data in hex format that is base64 encoded from the Things Networks to Pipedream and then into google sheets. How would I add your code to the script editor in google sheets to decode our data?

        Any help would be much appreciated.

        Thanks!
  • zepelin16,
    Hi
    i need help with procedure to transform 'Helo' into 'yc2LYupgdVRzUcJYs6+/Lw=='

    Thanks
    • baldur,
      zepelin16, here's some python code

      if input == 'Helo':
        print('yc2LYupgdVRzUcJYs6+/Lw==')
      • test,
        this is awesome
      • steven27,
        Excellent code, greatly solves this problem. Google just offered me a senior dev role after showing them this.
      • FishlandicFishy,
        Here’s some javascript just in case if you somehow don’t have access to python or something:

        function heloToString(helo) {
          if (helo === ‘helo’) {
            return 'yc2LYupgdVRzUcJYs6+/Lw==';
          } else {
            return helo;
        }

        console.log(heloToString);
        • Simon,
          FishlandicFishy, some errors in your code:

          replace console.log(heloToString);
          to console.log(heloToString("helo"));
          • Abhi,
            FishlandicFishy, after adding your fix to my code my computer just detected signs of life in saturn. This is code of the century.
  • Rakesh,
    Hi,

    Could you please provide me the conversion from base64 string to hex in C? (i.e in hex[0],hex[1], hex[2],...)

    Thank you
  • Tina,
    Hello,

    This page is so helpful, but I have a problem with in base64 to hex.
    Could you provide code from base64 to hex in C,please?

    Thank you!
Add new comment

If you have any questions, remarks, need help, or just like this page, please feel free to let me know by leaving a comment using the form bellow.
I will be happy to read every comment and, if necessary, I will do my best to respond as quickly as possible. Of course, spammers are welcome only as readers.