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

Base64 to File

Decode Base64 to file using the free online decoder, which allows you to preview files directly in the browser, as well as download them, get the hex dump for any binary data, and get summary information about the original file. Please note that the preview is available only for textual values and known media files such as images, sounds, and videos. In any case, you can always convert Base64 to binary and download the result as file, regardless of its MIME type. If you are looking for the reverse process, check File to Base64.

How to convert Base64 to file

  1. Paste your string in the “Base64” field.
  2. Press the “Decode Base64 to File” button.
  3. Click on the filename link to download the file.

What are the features of the decoder

After decoding the Base64 string, you’ll be able to:

  • Preview the file (for example, you will see an image or video player).
  • Download the file by clicking on the special link.
  • Read the information about the original file (such as MIME type, extension, size).
  • Analyze the hex dump of the file.
Comments (49)

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

  • Brian,
    Thanks for your webpages on base64 decoding ! I had an old MS Word document that was uuencoded and was wondering if the file was still intact. Your base64 repair page fixed some misaligned text and allowed me to save and read the Word doc again. Thanks again !
    • Administrator,
      Thank you for your detailed feedback! I am very glad that it fixed your unusual issue.
    I have tried convert to a >BMP file the following string (Visual Delphi Application). I supposse than image has been saved encrypted.


    • Administrator,
      Your string is a hex value. To convert it to Base64 use the Hex to Base64 converter. Next, you can preview your image using the Base64 to BMP converter.
  • islam,
    Thank you you solved my ctf
  • Pneuma01,
    Thank you !!

    I was able to extract the image file in .resx of My DOTNET project.
  • jaydeep,
    I want to convert base64 string convert and display in webview in android. i am trying but not work.
  • Werner,
    Nice little tool, works great. Thanks for putting this online. Greetings from the Netherlands.
  • base64victim,
    Hi Base64Guru,

    I have a string z4CwXBTbwvP+tcFMUmAKzPDdT0aiXild+VhnMKxiqtnQmezjNIx74eVHGWZwp3wIOSW1Z2mf7kKJS58t0+rUp6i3fVvVhPRb0APjotFRFcmyjwXhDw8xgysNU23h8gwF which I supect is base64...

    It comes from an SQL Database and seems to be 96 bytes long. I've tried a number of things (e.g. decode it with R and with Python - also with the zlib, since I initially suspected it might be a gzipped xml or something...). Nothing was successful. Can it be a proprietary coding alphabet? Your application says it's a valid base64 string and your character encoding said that the string is binary (just for my information: how do we know this?), so I decoded it to a file and inspected the hex dump - but I still do not have a clue :( I cannot display it in the browser, the MIME type is apperently application/ octet-stream. Can I output this as xml data, if yes, how?

    Do you have any hint for me what I can do next?

    Thanks for this fantastic page!


    • Administrator,
      This string is unlikely to be a compressed data. Perhaps, it may be a custom encoding algorithm/alphabet, but I think there is a higher probability that this string stores a raw output of some hashing/encryption algorithm. Anyway, to understand what it is, you need to analyze the source code of the application and the structure of the database (if you are lucky, there may be a comment describing that column).
      • base64victim,

        thanks very much for your quick answer! I will try that, so maybe I'm lucky.

        Greetings and again: great website!
  • tres,
    Quierea descargar y guardar el archivo en Base64 y enviar en un mail gracias
  • Santiago,
    Hello, I have a string (it is a base 64 zip), I need to convert to zip file, in your pagin came out perfect, it is possible to do it in php? THANKS!
  • CorePack,
    i want to decode this please

    • Administrator,
      Can you tell me more info about this string? Where did you get it from? Do you have any other examples?
      • CorePack,
        more examples


        more ----------

  • khid,
    How do you able to differentiate file format for microsoft documents (doc, ppt, xls)? Since their signature is the same.

    currently trying to figures out how
    • Administrator,
      Hi! I'm using the PHP function mime_content_type().
  • Nuno,
    Hi, I had problems with \n , new line characters, that are part of the spec of base64, every 76 characters we have a line break. I had to strip the \n for this page to work.
    • Administrator,
      Hello Nuno,
      The newline character (0x0A), as well as any whitespace do not interfere with decoding process and this decoder should decode such Base64 values without any problems. However, it won't decode the Base64 string if it contains the "\n" characters (that is, you see the backsplash and the "n" letter).
  • KC7PME,
    I have unsuccessfully tried, both by computer application and manually to decode the following strings which should be directions to a particular location in Lat/Long. I've tried UTF-8 and UTF-7. Can you assist me?


    • Administrator,
      Both strings are too long to represent geographic coordinates. Therefore, if you are sure about it, I believe that the data is encrypted and you will not be able to decrypt them without knowing the algorithm and the passphrase.
  • Damouse,
    This was sent to me thru email and was the supposed sender anybody know what it is I learned it's a base 64 octet stream from what I have gathered any thoughts.please that k you...

    • Administrator,
      It seems the message is damaged or you made a mistake while copying it. I recommend you take a look at the source of the message.
  • nicolas,
    Hi, I'm quite new here but I really do appreciate your work, that's impressive. I have a question here: I have to decode a B64 string and mostly need to know the mime type of the file (from a B64 string) it represents. Trieed to find some piece of code on your site, but I found only this page. I mean, I already converted the string in a Uint8Array and copied each ChardCode in it, but what can I do exactly from here to know the mime type or the extension? Thx a lot anyway for your work.
  • Norbert,
    In a Mail is one attachment:

    Content-Type: application/octet-stream; name=begleitdatei.xml
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment; filename=begleitdatei.xml


    How can I decode this to an Xml File?
    Thanks. Norbert
    • Administrator,
      Hello Norbert! You should remove everything except the Base64 value (for example, use the Repair Tool to extract the Base64 value).
  • Gerald,
    I have a base64 string of a zip file. When i paste it into the textbox, my entire browser lags out and becomes unresponsive, since the string is quite long. Any idea how i can decode this string to retrieve the zip file?
  • Henke,
    Ran the file to base64 on a .7z splited archive and got a filesize aprox 13Mb, as expected about 33% larger than the original.
    But when i paste that text here and run base 64 to file i get a filesize of 897.27KB:
    File Info
    • MIME type: application/x-7z-compressed
    • Extension: 7z
    • Size: 897.27 KB
    • Download: application.7z
    What should i try?
  • Rafael,
    Olá, porfavor preciso de ajuda, não encontro uma forma de saber qual a extensão de um arquivo em base64.
  • Evan,
  • Rodolfo,
    When you only have the base24 string, without the mime type included in it, how do you determine the file type?
    • Administrator,
      The best solution is to use magic numbers (although it gives false positives).
  • Andrew,
    Can someone help me with this? i can't figure it out.

  • Kel,
    I am trying to decode a image and display a string message such as "Hello world!", not the actual string of the image.
  • Omkar,
    Can you please tell us what is the charset of the value displayed in the "Preview" section ?
    This is because when we try to do the following in Java (JDK 7), the results do not match: -
    1) Decode the BASE64 text using javax.xml.bind.DatatypeConverter.parseBase64Binary() which returns a byte array.
    2) If the byte array is represented by a string using the API --> new String(byte[], Charset)...this gives a result which does not match with the result in the "Preview". Here all 166 Charsets supported by Java were tried and it did not match with any.

    Please help. :'(
  • Nivash,

    how to decode this
    i get this data from hospital laboratory blood test machine
    i think this is histogram or image but not confirm
    can you please tell me how to decode this?
    • Administrator,
      Hi! Yes, it should be binary histogram data. In order to convert your string to image you need to decode it from Base64 and "draw" the image using using the histogram "points".
      • Nivash,
        thank you for you quick reply

        then how to get histogram "points".

        if i convert this base64 data to text it give !.?TZZZZZZZZZZZZRE6' ...!!?
        • Administrator,
          The decoding result should already contain histogram "points", but depending on your development environment you need a library or a function to convert histogram "points" to image. If you don't have programming skills, please contact your dev team, as they can develop a solution for your problem.
          • Nivash,
            Okay! thank you very much

            great website :)
  • lazysander,
    Hi, can you help me to decode this please :
    • Nivash,
      hello lazysander.
      where you get from this code?
      what type of code?
      • lazysander,
        I had this code from a cryptographic challenge.
        I don't know the code.
        Perhaps it's XOR but I can't find the key, or maybe ASCII.. I have tried a lot of things but I can't decode it.
  • Raffaele,
    Hi Admin, i tried Base64 to File Decoder and it work fine, the result is zip file.
    Have you an example java code to do this, i've try Decode Base64 but not work.
    Thanks a lot.
  • Raffaele,
    Hi, the b64 String is like this : "..PUEsHCGnPUsA4EAAA LyUAAFBLAQIUABQACAgIAAFlrVBpz1LAOBAAAC8lAAAYAAAAAAAAAAAAAAAAAAAAAABHQ0FTU0Ff MDlKSUhQXzQ1Njc4OS54bWxQSwUGAAAAAAEAAQBGAAAAfhAAAAAA" is base64 binary and decode doesn't work but if i try with string like 'JVBERi0xLjUKJYCBgoMKMSAwIG9iago8PC9GaWx0ZXIvRmxhdGVEZWNvZGUvRmlyc3QgMTQxL04gMjAvTGVuZ3==' it work fine.
  • Bpp,
    Hi, This site is really sleep saver. I have one question, can you please share the code (jquery or typescript) how you are able to download the doc file using base64 data.
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.