Developer Tools

Base64 Encode

Encode text or upload a file to get its Base64 representation — free, instant, browser-based.

No uploads — browser onlyInstant result

Encode a file instead of text

Text Input

How to encode text to Base64

  1. Paste your text into the input area, or upload a file to encode.
  2. Click Encode to Base64 to generate the encoded string.
  3. Copy the result to your clipboard.

What is Base64?

Base64 is an encoding scheme that converts binary data to a set of 64 ASCII characters. It is commonly used to embed binary data (like images or files) in text-based formats like HTML, CSS, email (MIME), and JSON APIs.

Encode text or files to Base64 online

Paste any plain text and get its Base64 representation instantly. Your input is treated as UTF-8, so accented characters, emoji, and non-Latin scripts encode correctly. You can also use Upload file to Base64-encode an image or other file. Results appear immediately and are ready to copy to your clipboard. To go the other way, use Base64 Decode.

Common Base64 uses

  • Embedding small images or fonts directly in HTML and CSS as data URIs.
  • Carrying binary data inside text-only formats such as JSON or XML API payloads.
  • Email attachments, which are Base64-encoded under the MIME standard.
  • Encoding tokens or config values for transport between systems (for compatibility, not security).
  • Quick developer testing and debugging of encoded strings.

Working with images specifically? Image to Base64 and Base64 to Image are purpose-built for that, and the JSON Formatter helps tidy payloads that carry Base64 fields.

Base64 is encoding, not encryption

Base64 only changes how data is represented — it adds no secrecy. Anyone can paste a Base64 string into a decoder and read the original content, so never use it to protect passwords, API keys, or other secrets. For URLs and query strings use URL Encode and URL Decode; to inspect a JSON Web Token, use the JWT Decoder.

Why Base64 output is larger than the input

Base64 represents data using only printable ASCII characters, encoding every 3 bytes as 4 characters. That overhead makes the encoded text roughly a third larger than the original — the trade-off for being safe to paste into text-based formats.

Privacy — your data stays local

Encoding and decoding run entirely in your browser using native Web APIs. No data is sent to any server.

Frequently Asked Questions

Does Base64 encoding encrypt my data?

No. Base64 is encoding, not encryption. Anyone with the Base64 string can decode it back to the original. For encryption, use a proper cryptographic tool.

Can Base64 be decoded back to the original?

Yes. Base64 is fully reversible — paste the output into a Base64 decoder to get the exact original text or file back. That is also why it should never be used to hide passwords or secrets.

Does it support Unicode and UTF-8 text?

Yes. Text is encoded as UTF-8 before Base64, so emoji, accented characters, and non-Latin scripts all encode and decode correctly.

Why is the encoded output longer than the input?

Base64 encoding increases data size by approximately 33%, because it represents every 3 bytes of input as 4 ASCII characters.

Can I encode binary files like images?

Yes — use the Upload file option to encode any file type to Base64.

Is my text or file uploaded when encoding?

No. Encoding runs entirely in your browser using the native btoa and FileReader APIs. Your text and files never leave your device.

What is the difference between Base64 and Base64URL?

Base64URL is a variant that replaces + and / with - and _ so the result is safe inside URLs and filenames. This tool outputs standard Base64, not the URL-safe variant.

What is a data URI?

A data URI embeds Base64-encoded file data directly into HTML or CSS, e.g. src="data:image/png;base64,ABC123...".

Related tools