ConvertUnlimited

Base64 Encoder / Decoder

Encode and decode Base64 text locally in your browser.

Local developer encoding tool

Convert text and Base64 safely.

Encode Unicode text to Base64 or decode Base64 back to readable text with selected inputs processed locally in your browser.

Characters: 0 · Bytes: 0

What this tool does

Encode Unicode text to Base64 or decode Base64 back to readable text with selected inputs processed locally in your browser.

Privacy behavior

Selected file contents are processed locally in your browser for supported workflows. This privacy build does not intentionally load ads, analytics, remote fonts, or third-party runtime scripts.

Supported workflow

Use the controls on this page, review the output in your browser, then copy or download the result.

When should you use Base64?

Base64 is commonly used to represent text or binary data in APIs, embeds, tokens, and data transfer workflows where plain text transport is needed.

This tool validates Base64 before decoding and supports URL-safe variants that use hyphens and underscores.

How Base64 encoding works

Base64 represents binary data using only 64 printable ASCII characters: A-Z, a-z, 0-9, plus + and /, with = reserved for padding. It works by regrouping input bytes into 6-bit chunks, since 2 to the 6th power is 64, and mapping each chunk to one alphabet character. Three input bytes are exactly 24 bits, which splits evenly into four 6-bit groups, so Base64 always processes input in groups of 3 bytes and emits 4 output characters per group, padding the final group with = when the input length is not a multiple of 3.

This tool encodes by first converting text to UTF-8 bytes with TextEncoder, then building a one-byte-per-character binary string before calling btoa(). That extra step matters: calling btoa() directly on a JavaScript string containing characters above code point 255 throws an error, because btoa() only understands one byte per character. Decoding reverses the process with atob() followed by TextDecoder("utf-8", { fatal: true }), so decoded bytes must form valid UTF-8 or the tool reports an error instead of guessing.

The URL-safe checkbox switches to Base64url, defined in RFC 4648 section 5: the same alphabet with - replacing + and _ replacing /, with padding removed entirely.

PropertyStandard Base64Base64url (this tool, URL-safe checked)
Characters 62 and 63+ and /- and _
Padding= characters keptStripped after encoding
Safe unmodified in a URL query stringNo, + and / need percent-encodingYes
Typical useEmail attachments, data URIsJWT segments, URL-embedded tokens
Output size versus inputAbout 33 percent largerAbout 33 percent larger

Worked examples

Padding length depends only on input length modulo 3, shown here with a classic three-line demonstration:

InputLengthBase64 outputPadding
any carnal pleasure.20 bytesYW55IGNhcm5hbCBwbGVhc3VyZS4=1 character
any carnal pleasure19 bytesYW55IGNhcm5hbCBwbGVhc3VyZQ==2 characters
any carnal pleasur18 bytesYW55IGNhcm5hbCBwbGVhc3VyNone

Dropping one character shifts the input length modulo 3 from 2 to 1 to 0, which is why the padding count counts down from one = to two and then to none. Unicode input shows the same mechanics with an extra twist: café is 4 characters but 5 bytes in UTF-8, since é encodes as two bytes (0xC3 0xA9), so it encodes to Y2Fmw6k=, an 8-character result with 1 padding character, computed from the byte count rather than the character count.

Limits and gotchas

  • Text and binary are not interchangeable here. Decoding always assumes the result is valid UTF-8 text. Pasting Base64 that actually represents a JPG, PDF, or other binary file will fail decode with an error, since TextDecoder in strict mode rejects byte sequences that are not valid UTF-8; this tool cannot recover or download binary files from Base64.
  • Standard btoa() cannot handle Unicode directly. Code that calls btoa(someString) on arbitrary Unicode text elsewhere will throw InvalidCharacterError once a character above code point 255 appears; this tool avoids that by converting to UTF-8 bytes first, but the same trap applies if you copy encoding logic out of this page without the UTF-8 step.
  • Base64url output has no padding. A system expecting standard Base64 with trailing = characters may reject URL-safe output pasted in without restoring padding.
  • PEM-style armor is not stripped. Content copied straight from a certificate or key file, including -----BEGIN CERTIFICATE----- header and footer lines, is not valid Base64 on its own; those lines need to be removed first, since hyphens are not part of the standard Base64 alphabet.
  • Whitespace is normalized before decoding. Newlines and spaces inside pasted Base64 are stripped automatically, so multi-line, wrapped Base64 still decodes; stray characters outside the Base64 alphabet are not silently dropped and will fail validation instead.
  • No hard size limit is enforced. Very large input is bounded only by browser memory and how long the one-byte-per-character loop takes to run, not by a fixed cap in the tool.

Frequently Asked Questions

Is this Base64 tool free?

Yes. You can encode, decode, copy, and clear text without signup.

Is my text sent to ConvertUnlimited servers?

No server-side upload endpoint is used for this flow; encoding and decoding happen locally in your browser.

Does it support Unicode?

Yes. Text is converted to UTF-8 bytes before encoding, so emoji, accents, and non-Latin scripts round-trip correctly.

What is URL-safe Base64?

URL-safe Base64, or Base64url, replaces + and / with - and _ and removes padding, so encoded text can sit directly in a URL without percent-encoding.

What happens with invalid Base64?

The tool shows a friendly warning and keeps your original input rather than guessing at a partial decode.

Why did btoa() fail when I tried this in my own code?

Standard btoa() only accepts one byte per character and throws on Unicode text above code point 255. This tool avoids that by encoding text to UTF-8 bytes first, building a byte-safe string, and only then calling btoa().

Can this decode a Base64 image or file back to binary?

No. Decoding always assumes the result is UTF-8 text, so Base64 representing binary files such as images or PDFs will fail with a decode error rather than producing a downloadable file.

What is the difference between standard Base64 and Base64url?

Both use the same 6-bit grouping and 64-character logic. Standard Base64 uses + and / with = padding; Base64url swaps in - and _ and drops padding so the result is safe to use unmodified in URLs and tokens.

Privacy

Privacy build: This build removes ads, analytics, remote fonts, runtime CDN scripts, and file-operation telemetry. Selected files are processed in the browser using local JavaScript and browser APIs.

ConvertUnlimited does not provide a server-side upload endpoint for this Base64 encoding and decoding flow. Text input is processed locally in your browser.

Terms of Use

ConvertUnlimited is provided as is. Review encoded or decoded output before using it in production systems.

Privacy & processing

Trust and privacy

Files are processed locally where supported. Review the Trust Center for the processing model and the Privacy Policy for public-site privacy boundaries.