Base64 Encoder / Decoder
Base64 turns binary or text data into a safe ASCII representation — handy for embedding data in URLs, JSON, or email. This tool encodes and decodes instantly in your browser, with proper UTF-8 handling so emoji and non-Latin scripts (Urdu, Arabic, Chinese…) work correctly — something naive encoders get wrong.
Text → Base64
How it works
- Choose Encode or Decode mode.
- Type or paste your input.
- The output updates instantly as you type.
- Encode converts text → Base64; Decode converts Base64 → original text.
- Invalid Base64 input produces a clear, friendly error instead of garbage.
The formula
How it works
text → UTF-8 bytes → 6-bit groups → Base64 alphabet
Each 3 bytes become 4 Base64 characters; padding '=' fills the final group. Decoding reverses the steps exactly.
Worked example
Worked example
- Input: Hello, StudentKit!
- Base64: SGVsbG8sIFN0dWRlbnRLaXQh
Decoding SGVsbG8sIFN0dWRlbnRLaXQh returns the original string byte-for-byte.
Common mistakes
- Using String.fromCharCode/btoa directly on unicode — it corrupts non-Latin text. This tool uses the UTF-8-safe path.
- Copying Base64 with line breaks or extra whitespace — the decoder strips harmless whitespace automatically.
- Assuming Base64 is encryption — it's an encoding; anyone can decode it. Never put secrets in Base64.
Frequently asked questions
Is Base64 the same as encryption?
No — Base64 is reversible encoding, not security. Anyone can decode it. Never store passwords or tokens in Base64.
Why does my Base64 have = at the end?
Padding. Base64 groups bytes in threes; '=' characters pad the final group when the input length isn't divisible by three.
Does it work with non-English text?
Yes — encoding uses UTF-8, so Urdu, Arabic, Chinese, emoji and accented characters all survive the round trip correctly.
Where would a student use this?
Embedding images in HTML/CSS, passing data in URL query strings, reading API payloads, and understanding how email attachments are stored.
Related tools
Students who used Base64 Encoder / Decoder also reach for these.
JSON Formatter
Pretty-print, minify and validate JSON instantly in your browser. Clear error messages with line and column hints. Nothing you paste is sent anywhere.
GPA Calculator
Calculate your semester GPA by credit hours and letter grades. Supports 4.0 and 4.3 scales with instant, accurate results.
Percentage Calculator
Free percentage calculator: what percent is X of Y, what is X% of Y, and percentage change — three modes, instant answers.