Base64 Encoder & Decoder

Encode text to Base64 or decode it back to text instantly — with URL-safe mode, file encoding, and full Unicode support. Nothing leaves your browser.

Convert

Results update live as you type.

0
Input chars
0
Input bytes (UTF-8)
0
Output chars
100% private

Encoding happens locally in your browser with JavaScript. Your text and files are never uploaded anywhere.

No signup

Convert as much text as you like, instantly — no account, no email, no limits.

Free forever

UTF-8 safe encoding, URL-safe mode, file support, and auto-detect — all free, always.

How to use

  1. 1
    Pick a mode

    Choose Encode to turn text into Base64, Decode to turn Base64 back into text, or Auto-detect to let the tool decide.

  2. 2
    Enter your input

    Type or paste text into the input box — or pick a file to encode it to Base64. The output updates live as you type.

  3. 3
    Copy or download the result

    Use Copy output for the clipboard or Download output to save it as a .txt file. Use Swap to flip the result back into the input.

Features

Live conversion

The output updates on every keystroke — no buttons to press, no waiting.

UTF-8 safe

Uses TextEncoder and TextDecoder, so emoji, accented characters, and non-Latin scripts encode correctly — unlike plain btoa().

URL-safe mode

Toggle the URL-safe alphabet to get output with - and _ instead of + and /, safe for URLs and filenames.

File encoding

Pick any file — an image, a document, anything — and get its Base64 representation instantly, right in the page.

Auto-detect mode

Paste anything and the tool figures out whether it is text to encode or Base64 to decode.

Char and byte counts

See input characters, UTF-8 byte size, and output length at a glance.

Frequently asked questions

What is Base64?
Base64 is a way of representing binary data using only 64 safe text characters (A–Z, a–z, 0–9, +, /, and = for padding). It is commonly used to embed images in code, pass tokens in URLs and APIs, and store binary data in text formats like JSON.
Why do I get an "invalid Base64" error?
The input contains characters outside the Base64 alphabet, or its length is not a multiple of 4 after padding. Double-check for typos, stray spaces, or missing padding characters (=) at the end — or switch to Auto-detect mode.
What is URL-safe Base64?
Standard Base64 uses + and /, which have special meanings in URLs. The URL-safe variant swaps them for - and _. Turn on the URL-safe toggle when your output will live in a URL, a filename, or a JWT token.
Does it support Unicode and emoji?
Yes. This tool encodes with the UTF-8 byte representation (TextEncoder/TextDecoder), so any character — Arabic, Urdu, Chinese, emoji — round-trips correctly. Plain btoa() breaks on these; this tool does not.
Why is Base64 output longer than the input?
Base64 packs 3 bytes of data into 4 characters, so output is roughly 33% larger than the input. That is the trade-off for a text-safe representation.
Is it safe to encode passwords or private files here?
Yes — everything runs locally in your browser with JavaScript. Your text and files never leave your device. Note that Base64 is an encoding, not encryption: anyone can decode it, so never treat it as a way to hide secrets.
Is this tool really free?
Yes — free and unlimited, with no signup. It runs entirely in your browser, so there is nothing to pay for.
Try a sample or see input tips

Start small, review the output, then use your own input. Sample files contain synthetic data.

For file tools, download the sample first, then select it with the tool’s upload control. Your own file is never replaced automatically.

Keep going with your next task

Choose a related next step. Copy any result you want to reuse; opening a tool does not transfer your inputs.

Scroll to Top