CodeScript

Base64 Encoder / Decoder

Encode or decode Base64 for text and files.

What it does

Encode any text or file into a Base64 string, or decode a Base64 string back into readable text or a downloadable file. Text encoding is UTF-8 safe, so emoji and accented characters round-trip correctly.

Common errors

  • btoa() breaks on non-Latin1 text

    Naive use of the browser's built-in btoa() throws on characters outside Latin-1 (like emoji). This tool encodes via UTF-8 bytes first, so any text works.

  • Invalid Base64 padding

    Base64 strings must be a length that's a multiple of 4 (using = padding). A truncated or corrupted string will fail to decode.

FAQ

Very large files (hundreds of MB) can slow down or freeze the browser tab, since encoding happens on the main thread. For best results, keep files under a reasonable size.

Related tools