हिं हिन्दी

    File to Base64 converter

    Turn any file into Base64 or a data URL, and back.

    What do you want to do?

    or drop a file here

    Files never leave your device

    About this tool

    This tool converts any file, such as an image, PDF or font, into Base64 text or a data URL that you can paste into HTML, CSS, JSON or an API request. It also works the other way: paste Base64 or a data URL and get the original file back, with its type (PNG, PDF, ZIP…) detected from its first bytes. Base64 text is about 33% larger than the file, because every 3 bytes become 4 characters.

    At a glance

    What it does
    Turn any file into Base64 or a data URL, and back.
    Price
    Free, no sign-up
    Works in
    Your browser, on phone or computer. Works offline after the first visit.
    Privacy
    Files are processed on your device and never uploaded.

    How to convert a file to Base64

    1. Choose "File → Base64" and select your file.
    2. Pick "Data URL" or "Plain Base64" as the output.
    3. Click "Copy" or "Download .txt". For the reverse, choose "Base64 → File".

    Private

    Your files are processed in your browser and never uploaded.

    Fast

    No upload or queue. Results are ready in seconds.

    Free

    No sign-up, no limits and no watermark on your files.

    Frequently asked questions

    How do I convert an image to Base64 for HTML or CSS?

    Select the image and keep "Data URL" chosen. Copy the result and use it as the source, for example <img src="data:image/png;base64,iVBOR…"> or background-image: url("data:image/png;base64,…").

    How do I turn Base64 back into a PDF or image?

    Choose "Base64 → File", paste the text (with or without the data: prefix) and click "Decode to file". The file type is detected from its first bytes, so a PDF is named .pdf and an image is previewed before you download it.

    Why is the Base64 text bigger than my file?

    Base64 writes every 3 bytes as 4 text characters, so the text is about 33% larger: a 300 KB image becomes about 400 KB of Base64. That is why data URLs suit small images and icons better than large photos.

    Is there a size limit?

    Files up to 150 MB can be encoded. Only the first 2 million characters are shown on screen to keep the page fast; Copy and Download always use the full text.

    Are my files uploaded to a server?

    No. This tool runs entirely inside your browser, so your files never leave your device. Nothing is stored or seen by us.