← Developer

Base64 Encoder and Decoder

Encode and decode Base64 text and images directly in your browser.

Mode

Image to Base64

Select an image file to convert it to a Base64 data URI.

How it works

This tool encodes text to Base64 using the browser's built-in btoa function and decodes with atob. It handles Unicode text correctly by converting through TextEncoder and TextDecoder so multi-byte characters are preserved. You can also select an image file to convert it to a Base64 data URI, ready to paste into CSS, HTML, or JSON.

Everything runs locally in your browser. No data is uploaded or stored. It works on any modern browser, on both mobile and desktop. No cost, no signup, no tracking.


Frequently asked questions

Does this support Unicode and emoji, or only plain ASCII?

Full Unicode is supported. Text is run through TextEncoder to UTF-8 bytes before encoding, so accented characters, emoji, and other multi-byte symbols round-trip correctly. Plain btoa alone would throw on those characters, which is why this tool wraps it.

Can it decode URL-safe Base64 and strings with missing padding?

Yes. On decode, the input is normalized first: whitespace is stripped, the URL-safe characters - and _ are mapped back to + and /, and any missing = padding is added. So both standard and base64url variants decode without manual cleanup.

Why does image conversion cap at 10 MB?

Base64 inflates data by roughly 33 percent and the result is held in memory as a data URI, so very large files can slow or freeze the tab. The 10 MB limit keeps conversion responsive; smaller images produce data URIs that are practical to paste into CSS, HTML, or JSON.

Are my text and images uploaded anywhere?

No. All encoding and decoding happens in your browser using built-in functions and the File API. Nothing you paste or select is sent to a server, logged, or stored.


More tools from Clean.tools

View all tools

Use Clean.tools from your AI agent

This tool is also encode_decode on the Clean.tools MCP server — the same engine, callable by your AI agent directly. No key, no signup: requests are processed in memory and request contents are never stored.

Claude Code
claude mcp add --scope user --transport http clean-tools https://mcp.clean.tools/mcp
Any MCP client (streamable HTTP, authless)
https://mcp.clean.tools/mcp

Every tool, the REST API, and setup for Cursor, Claude Desktop, VS Code & more →