encoding

Base64 Encoder / Decoder

Encode text or data to Base64, or decode Base64 back to plain text.

What is Base64 Encoder / Decoder?

Base64 is an encoding scheme that converts binary data — or any text — into a string of 64 ASCII characters (A–Z, a–z, 0–9, +, /). It is used wherever binary data must travel through a medium that only handles text: embedding images in HTML or CSS, encoding credentials in HTTP Authorization headers, storing binary payloads in JSON, and passing data through URLs. Base64 does not encrypt data; it only changes the representation. The URL-safe variant replaces + with - and / with _ so the result is safe to embed in URLs and filenames without percent-encoding.

How to use Base64 Encoder / Decoder

  1. Paste your input: For encoding: paste the plain text you want to convert. For decoding: paste the Base64 string (with or without padding =).
  2. Select a mode: Choose 'encode' to convert plain text → Base64, or 'decode' to convert Base64 → plain text.
  3. Choose a charset: Use 'standard' for general purposes. Use 'url-safe' if the result will appear in a URL, filename, or JWT — it replaces + with - and / with _.
  4. Copy the result: Click the Copy button. The output field also shows the byte length of the source data.

Frequently asked questions

Does Base64 encoding encrypt my data?
No. Base64 is an encoding scheme, not encryption. Anyone who receives a Base64 string can decode it instantly without a key. Do not use Base64 to hide sensitive data.
What is the difference between standard and URL-safe Base64?
Standard Base64 uses + and / as its 62nd and 63rd characters. These have special meaning in URLs, so URL-safe Base64 replaces them with - and _ respectively. The output is otherwise identical and interchangeable if you handle the substitution correctly.
Why does Base64 output end with = or ==?
Base64 encodes every 3 bytes into 4 characters. If the input is not a multiple of 3 bytes, = padding is added to make the output length a multiple of 4. One = means 1 padding byte was added; == means 2.
Can I decode a Base64 image (data URI)?
Yes — paste the part after 'data:image/png;base64,' and decode it. The output will be binary data rendered as UTF-8, which may look garbled for non-text content. For images, use the Image Converter tool instead.
Is there a size limit?
The API endpoint accepts up to 1 MB of input. For larger files, use Node.js: Buffer.from(str, 'utf-8').toString('base64') for encoding, or Buffer.from(b64, 'base64').toString('utf-8') for decoding.
How do I Base64 encode an HTTP Basic Auth header?
Concatenate the username and password with a colon — for example 'alice:s3cr3t' — then Base64-encode the entire string using the standard charset. Prepend 'Basic ' to the result: Authorization: Basic YWxpY2U6czNjcjN0. Never use URL-safe Base64 for Basic Auth — servers expect the standard + and / characters.
Why does the same string produce different Base64 output in different tools?
The most common cause is a trailing newline or different line endings. Some tools append a newline character (\n) to the input before encoding, producing a longer output. Paste your string carefully and verify there is no invisible whitespace. Another cause is URL-safe vs standard charset: if one tool uses - and _ while another uses + and /, the outputs differ even for identical input.
What is Base64url encoding and where is it used?
Base64url is the URL-safe variant defined in RFC 4648 §5. It replaces + with - and / with _ and optionally omits padding (=). It is used in JWTs (the header and payload sections), OAuth tokens, URL-safe nonces, and any context where + and / would need percent-encoding. This tool's 'url-safe' charset produces Base64url output.

We use cookies to serve ads and measure traffic. Cookie policy · Privacy policy