Skip to Base64 encoder and decoder

Base64 Encoder & Decoder

Paste text to encode to Base64, or paste a Base64 string to decode it. UTF-8 safe, with URL-safe Base64. Runs in your browser.

Loading tool…

By Muhammad Abdullah Rauf · Founder, EverydayTools.proUpdated 2026-09-19· Reviewed by EverydayTools Editorial Team

What is Base64 encoding and decoding?

Base64 turns bytes into printable ASCII so text-only channels can carry them. This tool encodes text to Base64 and decodes a Base64 string back to text — UTF-8 safe, in your browser.

Base64 (RFC 4648) maps every 3 input bytes to 4 characters from A–Z, a–z, 0–9, +, and /. Encoding is not encryption: anyone can decode the result.

Use this page to encode text to Base64 or decode Base64 to text. UTF-8 is used, so emoji and non-Latin characters round-trip correctly. Turn on URL-safe mode for Base64URL (JWTs and query strings). Optional data URI output wraps an encode result as data:…;base64,…

If you need percent-encoding, JWT signature checks, or one-way hashes, use those dedicated EverydayTools pages instead.

How to encode or decode Base64

  1. Choose Encode or Decode

    Encode turns plain text into a Base64 string. Decode turns a Base64 string back into text.

  2. Paste your input

    Paste text to encode, or paste a Base64 string (or data URI) to decode. Conversion runs as you type.

  3. Use URL-safe or Data URI if needed

    URL-safe mode uses - and _ and drops padding. Data URI wraps encode output as data:mime;base64,…

  4. Copy the result

    Copy the output, download it as text, or swap input and output to reverse the conversion. Nothing is uploaded.

Base64 encode and decode examples

Encode text to Base64

Input

Hello, World!

Output

SGVsbG8sIFdvcmxkIQ==

UTF-8 bytes encoded with the standard alphabet and padding.

Decode Base64 to text

Input

SGVsbG8sIFdvcmxkIQ==

Output

Hello, World!

Decode reverses the mapping when the string is valid Base64.

Unicode and emoji

Input

Hello 👋 世界

Output

SGVsbG8g8J+RiyDkuJbnlYw=

Multi-byte UTF-8 sequences encode like any other bytes. Avoid Latin-1-only btoa() without TextEncoder.

HTTP Basic Auth

Input

apiuser:s3cr3t!

Output

YXBpdXNlcjpzM2NyM3Qh

Authorization: Basic plus this string. Always send it over HTTPS — Base64 does not hide the password.

JWT payload (Base64URL)

Input

eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ

Output

{"sub":"1234567890","name":"John Doe","iat":1516239022}

Enable URL-safe mode. This shows claims only; it does not verify the signature.

Base64 formats this tool supports

Standard Base64 uses + and / with = padding so the length is a multiple of 4. URL-safe Base64 (Base64URL) swaps those for - and _ and often omits padding so values survive URLs and JWTs. Text is encoded as UTF-8 bytes. On decode, whitespace and data:…;base64, prefixes are stripped, and strings that contain - or _ are treated as Base64URL.

A data URI embeds the payload inline, for example data:text/plain;charset=utf-8;base64,SGVsbG8=. That is useful for small snippets; large strings bloat HTML by about 33%.

Formula

3 bytes (24 bits) → four 6-bit indices → Base64 alphabet (+ optional = padding)

Assumptions

  • Text encode uses UTF-8 (TextEncoder)
  • Whitespace and data URI prefixes are stripped on decode
  • Strings with - or _ are treated as Base64URL
  • Pasted text is capped at 1,500,000 characters; files at about 1–2 MB

Limitations

  • Not encryption or password hashing
  • Does not verify JWT signatures
  • Not URL percent-encoding

Common Base64 mistakes

Treating Base64 as encryption

Anyone can decode it. Use HTTPS in transit and real encryption or hashing for secrets.

Trying to decode plain text

If the input has spaces or punctuation, it is probably not Base64. Switch to Encode, or paste a real Base64 string.

Putting standard Base64 in a URL

Enable URL-safe / Base64URL so + and / do not break the URL.

Confusing missing padding with a broken string

One or two = characters pad the length to a multiple of 4. This decoder adds padding when it is omitted.

Using Latin-1 btoa() for Unicode

Encode UTF-8 bytes first. This tool uses TextEncoder, so emoji and CJK work.

Reading binary decode output as text

If the preview looks garbled, download the decoded bytes as a file.

Base64 vs Base64URL

Same math. Different alphabet and padding rules.

AspectStandard Base64Base64URL
Alphabet (62–63)+ /- _
Padding= to a multiple of 4Often omitted
Best forMIME, headers, data URIsJWTs, query strings, filenames
This toolURL-safe offURL-safe on

Related encoding tools

This page encodes and decodes Base64. Use a different tool when the job is not reversible Base64.

Related toolUse this tool whenUse related tool when
URL Encoder / DecoderYou need Base64 or Base64URL.You need percent-encoding (%20, %26) for a URL or query string.
JWT DecoderYou only need to Base64URL-decode one JWT segment.You need header, payload, expiry, and signature context together.
Hash GeneratorYou need a reversible encoding.You need a one-way digest (SHA-256, etc.).
Text to HexYou want Base64 text.You want a hex dump of the same bytes.
HTML Entity EncoderYou need binary-safe ASCII for APIs or headers.You need & / &#…; escaping for HTML.

When this tool isn't the right choice

You need URL percent-encoding

Percent-encoding is a different mapping. Use the URL Encoder / Decoder.

You need full JWT verification

This tool can decode a segment. Signature and expiry checks belong on the JWT Decoder.

You need a one-way digest

Use the Hash Generator. Base64 is reversible.

What to do next

Continue the workflow with the right follow-up tool.

Advertisement

Frequently asked questions

What is Base64?

Base64 is a binary-to-text encoding. It represents bytes as A–Z, a–z, 0–9, +, and / so the data can travel through text-only formats such as JSON, email, and HTTP headers.

How do I encode text to Base64?

Select Encode, paste UTF-8 text, and copy the output. Example: Hello, World! becomes SGVsbG8sIFdvcmxkIQ==. Turn on URL-safe for Base64URL.

How do I decode Base64 to text?

Select Decode and paste the string. Whitespace and data URI prefixes are stripped. Use URL-safe mode for JWT-style strings with - and _.

Does Base64 encoding encrypt or hide my data?

No. It is reversible encoding with no key. Anyone can decode it. Use HTTPS and real cryptography for secrets.

What is URL-safe Base64?

URL-safe Base64 (Base64URL) replaces + with - and / with _ and often omits = padding so the string is safe in URLs, filenames, and JWTs.

Why does Base64 end with = or ==?

Padding keeps output length a multiple of 4. One = means one padding slot; == means two. Base64URL often omits padding.

Can Base64 encode Unicode text?

Yes. This tool encodes UTF-8 bytes, so emoji, accents, and CJK characters encode and decode correctly.

Does Base64 increase size?

Yes. Every 3 input bytes become 4 output characters — about 33% larger. That expansion is part of the encoding.

Can I decode Base64 online without uploading it?

Yes. Encoding and decoding on this page run in your browser. The string is not sent to EverydayTools servers.

Can I decode a JWT payload here?

You can Base64URL-decode one JWT segment to read JSON claims. That does not verify the signature. Use the JWT Decoder for a full token view.

Privacy, accuracy, and trust

Privacy

Encoding, decoding, and local file reads run in your browser and are not sent to EverydayTools servers. Copying a share link puts a short snippet in the URL; site analytics may record that URL.

Accuracy

Encode and decode are reversible for valid input. Size grows about 33%. This is not encryption.

How this tool works

Conversion runs in the browser after you paste text or choose a file.

Developer utility. Do not treat Base64 as security. JWT segment decode is not signature verification.

Advertisement

Reviewed by EverydayTools Editorial Team on 2026-09-19.

Same workflow or intent — pick the next step without leaving the site.

Frequently opened tools from the same category.

People also use

Cross-category tools others open in the same session.

Explore categories

Browse full tool collections by topic.