Encode Mode

Batch Input

0 Items

1 Output lines

0 Output chars

Encode and decode Base64 instantly

Base64 is a widely used encoding that turns binary data (or text bytes) into a safe, printable ASCII string. You’ll see it in:

  • API payloads
  • JWT tokens (Base64URL)
  • data URLs (data:…;base64,…)
  • email attachments (MIME)
  • config files and secrets
  • debugging logs

This tool gives you a fast Base64 encoder/decoder that runs entirely in your browser and updates live as you type.


What this Base64 Encoder & Decoder can do

  • Encode text → Base64 (UTF-8)
  • Decode Base64 → text (UTF-8)
  • Decode data URLs (automatically extracts the Base64 portion)
  • Batch process by newline (one value per line)
  • Trim lines in batch mode for cleaner input
  • URL-safe output (Base64URL: +-, /_)
  • Strip padding (=) for Base64URL workflows
  • Wrap at 76 characters for MIME/email conventions
  • Copy output in one click

Everything is client-side: no uploads, no accounts, no tracking of your content.


How to use it

1. Pick Encode or Decode

  • Encode: turns your text into Base64
  • Decode: converts Base64 back into text

You can switch modes instantly from the input panel.

2. Choose batch or single input

  • Batch by newline (recommended for lists): each line is treated as a separate item
  • Single input: treat the entire textarea as one value

3. Set optional formatting (Encode mode)

  • URL-safe: outputs Base64URL (great for URLs, JWT parts, web tokens)
  • Strip padding: removes trailing = characters
  • Wrap @ 76: inserts a newline every 76 characters

4. Copy the result

Use Copy to copy the output immediately.


Base64 basics (quick explanation)

Base64 is not encryption. It does not hide data—it only changes how it’s represented.

  • It takes bytes (e.g., UTF-8 text bytes)
  • Converts them into characters from a 64-character alphabet
  • Uses optional = padding so the output length aligns to blocks

It’s useful because it’s safe to transport through systems that expect printable characters.


URL-safe Base64 (Base64URL) explained

Standard Base64 uses:

  • + and / (which can be awkward in URLs)
  • = padding (often removed in tokens)

Base64URL replaces:

  • +-
  • /_

…and often removes padding.

This variant is heavily used in web contexts, especially:

  • JWT header/payload segments
  • URL query parameters
  • short tokens and IDs

This tool helps you generate Base64URL and also decodes it automatically by restoring padding when needed.


Data URL decoding

A data URL looks like:

data:text/plain;base64,SGVsbG8gd29ybGQh

When you paste a data URL in Decode mode, the tool:

  • detects ;base64,
  • extracts only the Base64 part
  • decodes it to UTF-8 text

This is handy when inspecting embedded assets or debug output.


When to use wrap @ 76

Some standards (especially email/MIME) wrap Base64 at 76 characters per line.

Use Wrap @ 76 when you:

  • need Base64 formatted for email systems
  • paste into legacy tools that expect wrapped output
  • want long Base64 strings to be easier to read

For most modern APIs, leaving wrapping off is best.


Practical use cases

Developers and API debugging

  • decode tokens and payloads for inspection
  • encode simple values for headers or config
  • batch transform multiple values quickly

Web and security workflows

  • produce Base64URL for web tokens
  • remove padding for URL parameters
  • decode Base64URL strings pasted from JWT segments

Content and data cleanup

  • convert many lines of input in one go
  • trim whitespace reliably in batch mode
  • catch malformed lines without breaking the rest of the batch

Email and legacy systems

  • wrap Base64 at 76 characters
  • create clean, compatible Base64 strings

Tips for reliable results

  • Base64 is case-sensitive. a and A are different.
  • Whitespace usually doesn’t matter in Base64. This tool removes whitespace on decode.
  • If decoding fails, check for:
    • missing padding (common in Base64URL)
    • invalid characters
    • copying extra symbols around the Base64 string
  • If you expect binary output (like an image), note that this tool decodes to text (UTF-8). For binary files, use a dedicated Base64-to-file tool.

Troubleshooting

“Invalid base64 length”

  • Base64 strings (after removing whitespace) should have a length divisible by 4.
  • Base64URL strings often omit padding. This tool restores padding automatically when it sees - or _, but if your input is missing those markers you may need to add padding manually or ensure the value is complete.

“Invalid base64 character”

  • The input contains a character not in the Base64 alphabet.
  • Remove surrounding quotes, commas, or accidental copy artifacts.

“I decoded it but see weird symbols.”

  • The decoded bytes may not be UTF-8 text (it might be binary data).
  • If you are decoding an image/audio/file, you’ll need a tool that converts bytes into a downloadable file.

“Batch mode shows errors on some lines.”

  • In batch mode each line is processed independently.
  • Fix the failing lines or remove them—valid lines will still decode/encode correctly.

Perfect for

  • encoding and decoding Base64 quickly
  • Base64URL and JWT-style workflows
  • decoding data URLs
  • batch converting lists of values
  • generating wrapped Base64 for MIME

If you need a fast, private Base64 tool that also handles real-world web variants like URL-safe strings, padding rules, and batch lists, this page is built for exactly that.

Frequently Asked Questions

It encodes and decodes UTF-8 text. Paste text to encode, or paste Base64 to decode. It can also decode Base64 embedded inside a data URL (for example: data:text/plain;base64,AAAA…).

Base64URL is a web-friendly variant that replaces '+' with '-' and '/' with '_' and often omits '=' padding. It’s commonly used in JWTs and URL parameters. This tool can output URL-safe Base64 and can also decode URL-safe Base64 automatically.

Standard Base64 may end with '=' or '=='. Stripping padding removes those characters, which is common in Base64URL. When decoding, the tool automatically restores padding if needed.

It inserts line breaks every 76 characters, a common formatting convention for Base64 in MIME/email and some legacy systems.

In batch mode, each non-empty line is treated as a separate item. This is ideal when you have many values to encode or decode at once.

No. Everything runs locally in your browser. Your data stays on your device while it’s encoded or decoded.

Explore Our Tools

Read More From Our Blog