Base64 Encode Decode

Encode text to Base64, or decode a Base64 string back to readable text — free, Unicode-safe, with URL-safe and bulk line-by-line modes, no sign-up.

Input
Output
Copied!
★
Rate This Tool
How was your experience?
— Loading…
🙂 Your feedback helps us make this tool even better!
How It Works

Format Your Code in 4 Simple Steps

Get a clean, usable result in just a few clicks — fast, easy, and completely free.

1

Paste or Upload Your Text

Copy your text, or paste a Base64 string, into the input box. Switch between the Encode and Decode tabs depending on which direction you need. If you'd rather not retype anything, the Upload File button loads a plain text file straight into the input box.

2

Choose a Direction and Any Options

Pick Encode or Decode depending on what you're starting with, and turn on URL-safe if the result needs to go into a link or token. Turn on Each Line Separately first if you're converting a list of short values instead of one long block.

3

Run the Conversion

Click Encode Text or Decode Text to run the conversion. If Each Line Separately is on, every line in the box is converted on its own — useful when you have a list of short values to encode or decode together. Use Swap any time to flip the input and output and run it the other way.

4

Copy or Download the Result

Review the result in the output panel, then use Copy to put it straight on your clipboard or Download to save it as a .txt file. If a decode attempt fails because the input isn't valid Base64, the tool tells you exactly that instead of silently producing garbled text.

Features

Everything You Need in One Tool

Built to be fast, clean, and easy to maintain — with no messy lines or hard-to-spot errors.

Unicode & Emoji-Safe Encoding

Unicode & Emoji-Safe Encoding

Most free Base64 tools fall over the moment your text includes anything outside basic English — an accented letter, an emoji, or a non-Latin script. This converter runs every encode and decode through proper UTF-8 handling, so a string containing café, 世界, or 👋 comes back exactly as it went in.

URL-Safe Mode

URL-Safe Mode

Standard Base64 uses the characters + and /, both of which have special meaning inside a URL and need escaping if you paste the result into a link or a JWT. Turn on URL-safe mode and this tool swaps those for - and _ and drops the trailing = padding automatically, producing a string that's safe to use directly in a URL, query parameter, or token.

Convert Many Lines at Once

Convert Many Lines at Once

If you're converting a list rather than a single value — API keys, short IDs, a batch of usernames — turning on Each Line Separately converts every line in the box independently in one click, rather than making you process each value on its own or merge them into a single block first.

Upload a File, 100% Client-Side

Upload a File, 100% Client-Side

Paste or type text directly, or use the Upload File button to load a .txt, .csv, .json, .log, or .md file without retyping its contents. Everything runs in your browser, so nothing you convert is ever uploaded to a server or stored anywhere.

Common Use Cases

Who Is This Tool For?

Whether you're working on a personal project or a professional one, this tool fits right in.

  • Developers Working with APIs & JWTs
    Developers working with APIs, JWTs, and Basic Auth headers use this tool to quickly encode credentials (generate one first with ToolFlexy's Password Generator if needed) or decode a token's payload to see what's inside.
  • Students Learning How Base64 Works
    Students and anyone learning how Base64 actually works can paste a string and immediately see the plain text it represents, without installing anything.
  • Writers & Support Teams Reading Logs
    Writers and support teams often need to decode a Base64 snippet pasted from an error log or an email attachment to read its actual contents — if the decoded result turns out to be JSON, ToolFlexy's JSON Formatter can pretty-print it next.
  • Anyone Building Links or Embeds
    Anyone building a link, embed, or query string that will carry a Base64 value reaches for the URL-safe mode so the result doesn't break when it's dropped straight into a URL.
Why It's Useful

Small Changes. Big Difference.

A little polish goes a long way — it saves time, reduces mistakes, and makes your work look more professional.

If a Decode Fails, Check for Extra Spaces First

If a decode attempt fails, check for extra spaces, line breaks introduced by email clients or chat apps, or a mix of standard and URL-safe characters in the same string — these are the most common reasons a Base64 string that looks fine still won't decode.

Turn on URL-Safe Before Pasting a JWT

When pasting a Base64 string from a browser's network tab or a JWT, turn on URL-safe mode first, since tokens almost always use the dash-and-underscore variant rather than standard Base64.

Combine Upload with Each Line Separately for Bulk Lists

For long lists, Each Line Separately together with Upload File let you load, convert, and download dozens of values without any manual formatting in between.

Use Swap to Double-Check Your Result

After converting, click Swap and run it again in the opposite direction — if you get back your original text exactly, you know the conversion worked correctly.

FAQs

Frequently Asked Questions

Find answers to the most common questions about this tool.

Base64 encoding turns binary or text data into a string made up only of letters, numbers, and a handful of symbols, so it can travel safely through systems — like email, URLs, or JSON — that weren't designed to carry arbitrary binary bytes. It's commonly used to embed images directly in CSS or HTML, pack the payload of a JWT, send file attachments over email protocols, and store small binary values inside text-only fields like JSON or XML.

No. Base64 is an encoding, not encryption — it makes data safe to transmit as text, but it provides no confidentiality at all. Anyone can decode a Base64 string back to its original form instantly, with no password or key required, which is exactly what this tool does. Never rely on Base64 alone to protect sensitive data; use real encryption for that.

The = at the end of a Base64 string is padding, added so the encoded output lines up to a multiple of 4 characters, which some decoders require to work correctly. You'll see one or two = characters depending on how evenly the original data divided into 3-byte chunks, and it's normal, expected, and safe to see at the end of standard Base64 output.

URL-safe Base64 replaces the two characters in standard Base64 that have special meaning inside a URL — + and / — with - and _, and usually drops the trailing = padding entirely. You need it whenever a Base64 string is going into a URL, a query parameter, or a token like a JWT, since standard Base64 characters would otherwise need extra escaping or could break the link.

This usually means the two tools used different settings, not that either one is wrong. The most common culprits are one tool using URL-safe characters while the other uses standard +/ characters, one tool stripping or keeping the trailing = padding differently, or the original text being encoded with a different character set before conversion — this tool always uses standard UTF-8, which covers virtually every real-world case correctly.

Yes — turn on Each Line Separately before running the conversion, and every line in the input box is encoded or decoded on its own instead of being treated as one long block. This is useful for converting a list of short values, like API keys or usernames, in a single pass.

Yes. Unlike many free Base64 tools that only handle basic English characters correctly, this converter runs every encode and decode through proper UTF-8 handling, so accented letters, emoji, and non-Latin scripts come back exactly as they went in.

There's no practical limit for pasted text, and file uploads are accepted up to 2MB — generous for a text file. Everything processes instantly in your browser with no sign-up and no server upload.

This tool is for plain text — type or paste a string and encode or decode it. ToolFlexy's Image to Base64 tool is built specifically for image files, converting a picture into a Base64 data URI you can embed directly in CSS or HTML. Use whichever one matches what you're actually starting with.

Ready to Get Started?

Try Our Base64 Encode Decode Now

Free, fast, and no sign-up required — give it a try in seconds.

Use Tool