Free, private, browser-only utilities
Advertisement · 728 × 90

Base64 Encoder / Decoder

Encode text and files to Base64 or decode Base64 back to text, instantly and offline in your browser.

Plain text input
Base64 output

Base64 encoding shows up everywhere in web development — embedding small images as data URIs, encoding Basic Auth credentials, packing binary data into JSON, or decoding a JWT payload. This tool encodes plain text or entire files to Base64, decodes Base64 back to readable text, and does it all instantly in your browser.

Swap between encode and decode with one click, or drop in a file directly to get its Base64 representation without writing a single line of code.

How to use the Base64 Tool

  1. 1

    Choose a mode

    Select Encode to turn plain text into Base64, or Decode to turn Base64 back into readable text.

  2. 2

    Enter your input

    Type or paste text into the left-hand panel — the output on the right updates instantly as you type.

  3. 3

    Or encode a file

    In Encode mode, click Encode a file to select any file from your device and get its raw Base64 string, ready to embed in code or a data URI.

  4. 4

    Swap direction

    Use the Swap button to instantly flip the current output into the input field for the opposite mode — handy for round-tripping a value.

  5. 5

    Copy the result

    Click Copy output to grab the encoded or decoded text to your clipboard for pasting elsewhere.

  6. 6

    Download as a file

    Click Download to save the current output as a plain text file instead of copying it.

Why convert in your browser instead of uploading to a server?

No token or secret ever leaves your browser

Base64 is frequently used to encode API keys, auth headers, and JWT tokens — exactly the kind of values you don't want passing through a third-party server's logs. Local encoding uses the browser's native btoa/atob functions, so nothing is transmitted.

No file size limit for file encoding

Server-based encoders often refuse files above a few megabytes. Because the FileReader API reads your file directly in-browser, larger files are limited only by available memory, not an arbitrary server-side cap.

Instant, character-by-character feedback

Encoding and decoding happen on every keystroke with no network round trip, so you see results the moment you stop typing rather than waiting on a request.

Correct handling of Unicode text

The encoder correctly handles multi-byte Unicode characters (emoji, accented letters, non-Latin scripts) by encoding through UTF-8 first, avoiding the classic 'binary string' bugs that trip up naive btoa() usage.

Frequently asked questions

Why do I get an error when decoding some Base64 strings?+

Base64 strings that are truncated, contain invalid characters, or are missing padding characters (=) will fail to decode — the error message flags this so you can check the source string for corruption.

Can I encode an image or PDF file to Base64?+

Yes — use Encode a file in Encode mode to select any file type. The resulting Base64 string is exactly what you'd embed in a data: URI or send in a JSON payload.

Is Base64 the same as encryption?+

No — Base64 is an encoding scheme, not encryption. It's fully reversible by anyone with no secret key required, so it should never be relied on to protect sensitive data from being read.

Does this handle URL-safe Base64 variants?+

This tool implements standard Base64 (using + and / characters). If you're working with URL-safe Base64 (using - and _), you may need to substitute characters before decoding.

Why did my encoded output look different from another tool's?+

Standard Base64 output should be identical across correctly implemented tools for the same input. Differences usually mean one tool is using a URL-safe variant, or the input text encoding differs.

Can I decode a JWT with this tool?+

You can decode the header and payload segments of a JWT (each is separately Base64-encoded) by pasting just that segment — this tool doesn't parse the JWT structure itself, only raw Base64 in and out.

From debugging a malformed Basic Auth header to embedding a small icon directly in your CSS as a data URI, Base64 conversion is one of those small, frequent tasks that shouldn't require opening a new terminal or trusting a random website.

Since everything runs through your browser's built-in encoding functions, results are consistent, fast, and never leave a trace on any server.