DevToolsForYou
Private by defaultRuns in your browser

Base64 file encoder / decoder

Encode any file or text to Base64, or decode Base64 back to a file or text string — entirely in your browser.

Click to choose a fileor drag and drop here
Quick samplesLoad text to encode
Base64 Files

About this tool

Encode any file (image, PDF, binary, certificate, etc.) or plain text to Base64, or decode a Base64 string back to its original file or text — all in your browser, nothing uploaded to a server.

No signup requiredRuns in your browserInstant results
How to use
  1. 1

    To encode: upload a file using the file picker, or type / paste text into the text tab, then click Encode.

  2. 2

    The Base64 output appears in the result box and can be copied or downloaded as a .txt file.

  3. 3

    To decode: paste a Base64 string into the Decode tab, then click Decode.

  4. 4

    For binary files, use the Download decoded file button to save the result; for text, the decoded content appears inline.

Why use this tool?
  • Embed images directly in HTML or CSS as data URIs using Base64.

  • Encode a certificate or key file to include in a JSON config or environment variable.

  • Decode a Base64-encoded attachment from an email or API response.

  • Encode binary assets (fonts, icons) for use in data URLs in frontend projects.

ExamplesInput → output

Encode text

InputHello, World!
OutputSGVsbG8sIFdvcmxkIQ==

Decode

InputSGVsbG8sIFdvcmxkIQ==
OutputHello, World!
Common errorsAnd how to fix them

Decoded output looks like binary garbage

Cause: The original file was a binary format (image, PDF, etc.) so the decoded bytes are not valid UTF-8 text.

Fix: Use the Download decoded file button instead of viewing the decoded content as text.

Invalid Base64 string

Cause: The pasted string contains characters outside the Base64 alphabet (A–Z, a–z, 0–9, +, /, =), such as spaces or line breaks.

Fix: Remove any whitespace or newlines from the Base64 string before decoding, or use the strip whitespace checkbox.

Frequently asked questionsCommon questions answered

These answers explain common base64 files tasks, expected input formats, and edge cases so both visitors and search engines can understand what this tool does.

What file types can I encode?

Any file type — images (PNG, JPEG, GIF, SVG, WebP), PDFs, certificates (PEM, CRT), archives (ZIP), fonts (TTF, WOFF), or any arbitrary binary. The encoder reads the raw bytes regardless of type.

Is there a file size limit?

There is no hard limit enforced by the tool, but very large files (over ~50 MB) may be slow because the entire file must be read into browser memory. For large files, use the openssl base64 command-line tool.

What is the difference between standard and URL-safe Base64?

Standard Base64 uses + and / as the 62nd and 63rd characters. URL-safe Base64 replaces them with - and _ so the output can be used safely in URLs and filenames without percent-encoding. The tool outputs standard Base64 by default, with a URL-safe toggle.

Is my file uploaded to a server?

No. Everything happens in your browser using the FileReader API. Your file bytes never leave your machine.