ToolUniverse

Base64 Encoder

Convert text, JSON, or code into Base64 instantly — free, unlimited, in your browser.

Frequently asked questions

Is my text uploaded anywhere?
No. Encoding happens entirely in your browser using the Web Crypto/Encoding APIs — nothing is sent to a server.
Is Base64 encryption?
No. Base64 is an encoding, not encryption — anyone can decode it back to the original text. Don't use it to protect sensitive data.
Why is the output longer than my input?
Base64 represents every 3 bytes of input as 4 output characters, so encoded text is roughly 33% larger than the original — shown as Encoding Overhead below the result.
Does this handle Unicode text correctly?
Yes — text is encoded as UTF-8 bytes before Base64 conversion, so accented characters, emoji, and non-Latin scripts round-trip correctly when decoded.
What's the difference between standard and URL-safe Base64?
Standard Base64 (RFC 4648 §4) uses + and / and pads with = to a multiple of 4 characters. URL-safe Base64 (RFC 4648 §5) replaces + with - and / with _ and typically omits padding, so the result can be placed directly in a URL without percent-encoding. JWT segments always use the URL-safe variant.
Why does the standard alphabet sometimes end in one or two = characters?
Padding characters fill out the final group to a multiple of 4 output characters when the input length isn't a multiple of 3 bytes. One = means the input had one byte left over after the last full group of 3; two = means two bytes were left over.
Can I encode a file, not just text?
This tool accepts pasted text. For binary files, use a tool designed for byte-level input — encoding arbitrary bytes as text first (as you'd do for an image) requires reading the file's raw bytes rather than typing them.
Is Base64-encoded text safe to search or index?
Base64 output is reversible, so treat it exactly like the original text for sensitivity purposes — encoding a secret does not hide it from anyone who decodes the string, which takes a fraction of a second.

You might also need

What is the Base64 Encoder?

The Base64 Encoder converts plain text, JSON, XML, code snippets, or configuration data into Base64 — a text-safe encoding used for embedding binary-ish data in places that only accept ASCII, like JSON fields, URLs, HTTP headers, and config files. Everything runs client-side, so nothing you paste ever leaves your browser. Base64 is not compression and not encryption. It exists because many transport formats — email (MIME), HTTP headers, JSON strings, and URLs — were designed around printable ASCII characters and can't safely carry arbitrary bytes. Base64 maps every 3 bytes of input to 4 output characters drawn from a 64-character alphabet (A–Z, a–z, 0–9, +, /), so any byte sequence, text or binary, becomes a string that survives being copied, pasted, or transmitted through systems that would otherwise mangle raw binary data. This encoder supports both the standard alphabet (RFC 4648 §4) and the URL-safe alphabet (RFC 4648 §5), which replaces + and / with - and _ and drops padding so the result can be used directly inside a URL path or query parameter without additional escaping. Output can be copied directly or downloaded as a text file, and results can be sent straight to the JWT Decoder for inspecting a manually constructed token segment.

Use cases

  • Embedding a JSON payload or image data inside another JSON document or config file
  • Preparing a Basic Auth header value (username:password) for an HTTP request
  • Encoding a JWT payload segment for inspection or manual construction
  • Converting a config file or manifest into a text-safe format for environment variables or CI pipelines
  • Producing a URL-safe token or identifier that can sit in a query string without percent-encoding
  • Encoding small binary assets (icons, certificates) for inline use in CSS, HTML, or JSON
  • Generating test fixtures that require a known Base64-encoded value
  • Converting between standard and URL-safe Base64 alphabets without re-deriving the value by hand

How to use the Base64 Encoder

  1. 1

    Paste your text

    Paste or type any text into the input panel — plain text, JSON, XML, or code.

  2. 2

    Choose an alphabet

    Pick the standard Base64 alphabet, or switch to URL-safe if the result needs to sit inside a URL.

  3. 3

    Encode

    Click Encode to Base64 (or press Ctrl/Cmd+Enter) to convert it.

  4. 4

    Copy or download

    Use Copy to grab the result, or Download to save it as a text file.

Examples

Plain text

hello
aGVsbG8=

JSON payload

{"id":1,"name":"Ada"}
eyJpZCI6MSwibmFtZSI6IkFkYSJ9

URL-safe output

hi?
aGk_

Standard Base64 would encode this as "aGk/", which is unsafe to place directly in a URL path.

We use cookies for analytics and ads. Choose whether to allow them.