പ്രധാന ഉള്ളടക്കത്തിലേക്ക് പോകുക
Calculator Tools
ദൈനംദിന ടൂളുകൾസൗജന്യംരജിസ്ട്രേഷൻ വേണ്ട

Base64 Encoder / Decoder - Free Online Calculator

Encode any text to Base64 or decode Base64 back to text. UTF-8 safe - handles emoji, Hindi, Tamil, Chinese and any Unicode. Runs entirely in your browser; nothing is sent to a server.

  • Formula shown on the page
  • Runs in your browser
  • Your inputs stay private
Input length: 31 · Output length: 44

Some content is still shown in English.

About

Understanding the Base64 Encoder / Decoder

Base64 is the workhorse encoding for moving binary or special text data through systems designed for plain ASCII. Email attachments, embedded images in HTML/CSS (data URIs), JWT tokens, API authentication headers, image data in JSON responses, encoded credentials in URLs - Base64 is everywhere in modern software. This converter handles UTF-8-safe encoding and decoding so it works seamlessly with text in any language including Hindi, Tamil, Bengali, Chinese, Arabic, emoji, and other non-ASCII characters that would corrupt under naive byte-level Base64.

Common scenarios where this tool helps: decoding a JWT token to inspect its payload during development; encoding an API key or username:password into HTTP Basic Auth format; debugging a Base64-encoded image in an HTML email; decoding configuration values stored in environment variables; quickly testing API responses that include Base64-encoded fields. All conversion happens in your browser - your input text, however sensitive (passwords, tokens, personal data) is never sent to a server.

How to use

Using the Base64 Encoder / Decoder in 3 steps

  1. Pick mode: encode or decode.

  2. Paste your input.

  3. Copy the result.

The formula

How the Base64 Encoder / Decoder works

Encoding converts text to UTF-8 bytes, then groups every 3 bytes into 4 characters from a 64-char alphabet (A-Z, a-z, 0-9, +, /). Decoding reverses the process.

Formula

3 bytes → 4 Base64 chars Padding '=' to multiple of 4 chars

  • AlphabetA-Z, a-z, 0-9, +, /
The maths

How the Base64 Encoder / Decoder gets its answer

Base64 takes binary data and encodes it into 64 printable ASCII characters: A-Z (26), a-z (26), 0-9 (10), plus '+' and '/' (2). Every 3 input bytes (24 bits) become 4 output characters (4 × 6 bits = 24 bits). When the input length isn't divisible by 3, padding '=' characters fill the output to a multiple of 4. This guarantees the encoded form is safe to transport through 7-bit ASCII channels like email and HTTP headers.

UTF-8 safety: text in non-ASCII alphabets (Hindi, emoji, etc.) is first converted to its UTF-8 byte sequence - for example, 'नमस्ते' is 18 UTF-8 bytes, not 6 characters. Those bytes are then Base64-encoded. This calculator uses TextEncoder/TextDecoder for correct UTF-8 handling. The simpler btoa()/atob() functions in browsers only handle Latin-1 and break on Unicode - a common bug in junior developer code.

Encoding overhead: Base64 output is approximately 4/3 the size of input (33% larger). For 1 KB of input, expect ~1.37 KB of Base64. This is the cost of converting binary to printable ASCII. Some variants exist - URL-safe Base64 (replaces '+' with '-' and '/' with '_' to avoid URL encoding issues), Base64 without padding (used in JWT), and others. This calculator uses the standard RFC 4648 alphabet with padding.

Examples

Worked examples

Encode HTTP Basic Auth: admin:Welcome2026

Input: admin:Welcome2026. Base64: YWRtaW46V2VsY29tZTIwMjY=. Used in HTTP header: Authorization: Basic YWRtaW46V2VsY29tZTIwMjY=. Standard format for API basic authentication.

Decode JWT payload

JWT structure: header.payload.signature, each Base64URL encoded. Payload like eyJzdWIiOiIxMjM0In0= decodes to {"sub":"1234"}. Useful when debugging authentication issues to see token contents (but signature verification requires the secret).

Encode Hindi text: नमस्ते

नमस्ते = 18 UTF-8 bytes. Base64: 4KSo4KSu4KS44KWN4KSk4KWH. The result is much longer than input characters because Hindi UTF-8 encoding uses 3 bytes per character.

Use cases

When to use the Base64 Encoder / Decoder

  • Debugging JWT tokens by decoding the payload section.
  • Generating HTTP Basic Auth headers (Authorization: Basic <base64-of-user:pass>).
  • Encoding small images or icons as data URIs for inline HTML/CSS embedding.
  • Encoding/decoding configuration values stored as environment variables.
  • Reading email attachments encoded as Base64 in raw MIME messages.
  • Generating safe text representations of binary data for logging or display.
  • API testing - decoding Base64-encoded fields in JSON responses.
  • Quick reversible transformations for non-sensitive obfuscation (not security).
Watch out

Common mistakes and gotchas

  • Treating Base64 as encryption. It's encoding only - anyone can decode it in seconds.
  • Using browser's btoa()/atob() with Unicode text. Use TextEncoder + btoa or modern equivalents.
  • Forgetting Base64 grows the size by ~33%. Don't use it for large payloads where bandwidth matters.
  • Confusing Base64 with URL encoding (%20 for space). They serve different purposes.
  • Mixing standard Base64 ('+' and '/') with URL-safe Base64 ('-' and '_'). Decoders may not accept the wrong variant.
Pro tips

Get more out of this tool

  • Base64-encoded SVG icons make great inline data URIs for small icons in CSS background-image.
  • JWT tokens are Base64URL - the '+' and '/' are replaced with '-' and '_' and padding may be omitted.
  • For Unicode safety, this calculator handles UTF-8 conversion automatically. Many naive implementations don't.
  • Don't Base64 to 'hide' passwords or secrets. Use proper encryption (AES, RSA) with secure key management.
  • Pair with the hash and JSON tools for related developer utility tasks.
FAQ

Questions about the Base64 Encoder / Decoder

Why is Base64 used?

Email, JSON and HTTP headers were designed for ASCII. Base64 lets you safely transport binary data through these channels.

Is Base64 encryption?

No - it's encoding, not encryption. Anyone can decode it instantly. For privacy use proper encryption (AES, RSA).

Why is the result longer than input?

Base64 expands data by ~33%. Three bytes become four characters. Plus padding to a multiple of 4.

Does it support binary files?

This tool focuses on text. For files, browsers offer FileReader.readAsDataURL - beyond the scope of a calculator.

Small tools that save real time

Date math, password generation, QR codes, IP subnets, base64 encoding, dew point, dice rolls, age calculations - none of these are 'big' problems individually, but they are the small frictions that interrupt your day. This tool runs entirely in your browser, has no popup, no chat widget and no tracking inside the calculation, so you can finish the task and move on.

Many tools in the Daily Utilities category complement each other - date difference + day counter + day-of-the-week, or password generator + QR code + base64 encoder. The related-tool grid links them together so you can move between adjacent problems in a click.

The Base64 Encoder / Decoder is part of the Daily Utilities suite on Online Calculator Tools, alongside 6 related calculators. All tools share the same UI patterns, the same privacy-first rendering (nothing is sent to a server), and the same commitment to showing the formula and assumptions behind every result.