b2KIT

Base64 Encoder / Decoder

Encode text or files to Base64 and decode Base64 strings back to their original form.

How to Use Base64 Encoder / Decoder

  1. 1

    Paste your input

    Enter plain text to encode or a Base64 string to decode.

  2. 2

    Choose the direction

    Select encode to convert text or decode to reveal the original.

  3. 3

    Copy the output

    Click copy to grab the encoded or decoded result.

Tested tool guide Developer and data tools Checked July 30, 2026

What Base64 Encoder / Decoder does, with a checked example

Base64 represents binary data with a restricted set of printable characters. This tool encodes text as UTF-8 bytes before producing Base64, and reverses that process when decoding. Base64 is an encoding, not encryption: anyone who receives the string can decode it without a key.

Worked example

A concrete input and expected output from the current implementation.

Input

b2KIT

Expected output

YjJLSVQ=

The five UTF-8 bytes for b2KIT are grouped into six-bit values and mapped to the standard Base64 alphabet. The final equals sign is padding.

How the result is produced

1

Text is converted to bytes first

A TextEncoder creates UTF-8 bytes so accented characters and other Unicode text are handled consistently. Encoding JavaScript code units directly would corrupt many non-ASCII strings.

2

Whitespace is ignored during decode

The decoder removes spaces and line breaks before calling the browser Base64 decoder. This permits wrapped Base64 content while still reporting invalid alphabet or padding errors.

Good uses

  • Inspect a Base64 field in JSON, XML, or an email payload.
  • Create a short data value for a test fixture.
  • Decode text copied from a browser developer tool.

Limits and checks

  • Base64 output is usually about one third larger than the original bytes.
  • A decoded byte sequence is not guaranteed to be valid UTF-8 text.
  • Do not treat Base64 as a security or password-protection mechanism.

Common questions

Why does Base64 sometimes end with equals signs?

Padding completes the final four-character group when the input byte count is not divisible by three. Some protocols omit padding, but the underlying data is unchanged.

Is Base64URL the same format?

No. Base64URL substitutes URL-safe characters for plus and slash and often omits padding. JWT segments, for example, use the URL-safe variant.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools