godz.online
Back to tools

Developer tools

Base64 encoder & decoder

Encode text to Base64 or decode it back, and turn any file into a data URI. Everything runs in your browser - nothing is uploaded.

Mode
Alphabet
Output

File to data URI

Choose a file (best for small images and icons) and copy its data: URI. The file is read locally and never uploaded.

Data URI

How it works

Paste text to encode it as Base64, or paste Base64 to decode it back. Base64 represents arbitrary data using only 64 printable characters, which is why it is everywhere: embedding images in CSS or HTML, encoding binary payloads in JSON, basic authentication headers, and email attachments. Text is treated as UTF-8, so accented letters, non-Latin scripts, and emoji all round-trip exactly. Switch to Decode and the tool turns Base64 back into readable text, flagging input that is not valid Base64 instead of producing garbage.

A standard or URL-safe variant toggle changes the two characters that differ between the alphabets: standard Base64 uses + and /, while the URL-safe variant uses - and _ so the result is safe in a URL or filename without further escaping. There is also a file to data URI panel: choose any file and the tool reads it locally and builds a data: URI with the correct MIME type and Base64 payload, ready to paste straight into an img src or a stylesheet. Everything runs in your browser, so nothing you type or load is uploaded.

Example. Encoding "Hello, world!" gives SGVsbG8sIHdvcmxkIQ==. Decoding reverses it exactly. Drop a small PNG into the file panel and you get data:image/png;base64,iVBORw0KGgo... which you can use directly as an image source.

FAQ

What is Base64 and why is it used?

Base64 is a way to represent any data using 64 safe, printable characters (A to Z, a to z, 0 to 9, and two extras). It lets binary data travel through channels that only reliably handle text, such as JSON fields, URLs, email bodies, and data URIs. It is an encoding, not encryption: it provides no security, only a text-safe representation, and it makes the data about a third larger.

What is the difference between standard and URL-safe Base64?

They use the same alphabet except for two characters. Standard Base64 uses + and /, which both have special meaning in URLs and file paths. URL-safe Base64 swaps them for - and _ so the encoded string can be dropped into a URL, query parameter, or filename without being escaped. The toggle here switches between the two for both encoding and decoding.

How does the file to data URI feature work?

Pick a file and the tool reads it entirely in your browser, then builds a data: URI of the form data:[mime-type];base64,[payload]. That single string embeds the whole file, so you can paste it as an image source or background without a separate request. It is best for small assets - because Base64 inflates size by about a third, large files produce very long URIs.

Is my data uploaded anywhere?

No. Encoding, decoding, and reading files all happen locally in your browser using the built-in APIs. Nothing you paste or select is sent to a server, logged, or stored, so it is safe to use with private data.