All Over Tools logo
Tool Combiner
Analyze Tools Clean Tools Compare Tools Convert Tools Data Validation Extract Tools Format Tools Generate Tools Organize Tools Transform Tools
Audio Tools Font Tools Image Tools Subtitle Tools Video Tools
Archive Tools Document Tools Ebook Tools File Management Tools PDF Tools Presentation Tools
Config Tools Database Tools Dataset Tools JSON Tools Parser Tools Spreadsheet Tools XML Tools
Business Calculators Construction Calculators Date And Time Calculators Education Calculators Financial Calculators Food Calculators Health Calculators Math Calculators Science Calculators Sports Calculators Statistics Calculators
Blog About Us Contact Us

Base64 Encoder / Decoder

Encode text to Base64 or decode Base64 back to text, with support for both the standard and URL-safe alphabets.

Input

How to use the Base64 encoder and decoder

Paste text or Base64 into Input. Choose Auto-detect, Encode, or Decode under Mode, then choose Standard (+ /) or URL-Safe (- _) under Variant. The result appears in the read-only Output area. Encoding turns the text into UTF-8 bytes before producing Base64; decoding turns Base64 bytes back into UTF-8 text.

  1. Paste text or a Base64 string into Input.
  2. Choose Auto-detect, Encode, or Decode under Mode.
  3. Choose Standard (+ /) or URL-Safe (- _) under Variant.
  4. Use Copy or Download below Output.

How to encode text to Base64

Choose Encode when Input contains text. The script converts it to UTF-8 bytes and writes the Base64 result to Output. Standard (+ /) uses the standard alphabet and keeps its = padding. URL-Safe (- _) changes + and / to - and _, then removes trailing = characters.

Input
Hello

Output
SGVsbG8=

How to decode Base64 to text

Choose Decode when Input contains Base64. The decoder trims the value, removes whitespace inside it, accepts standard and URL-Safe symbols, and adds missing = padding before decoding. It returns UTF-8 text. Binary bytes can appear as replacement characters because the decoder uses non-fatal UTF-8 decoding.

Input
SGVsbG8=

Output
Hello

Invalid Base64 clears Output and places the error in the status area. Check the input when the returned text contains replacement characters.

What Auto-detect does with Base64 input

Auto-detect removes surrounding whitespace and whitespace inside the value before checking it. It chooses Decode only when the cleaned value is non-empty, matches the accepted Base64 characters, and has a length divisible by 4. Every other value goes to Encode. Choose Decode yourself when you have an unpadded value that fails this check.

Upload text and save Base64 output

Select Upload to place an accepted text file in Input. The file control accepts .txt, .csv, .log, .md, and text/plain. Copy writes the current Output to the clipboard. Download saves it as base64-encoder-and-decoder-output.txt.

When another text converter is a better fit

Use Text Conversion Tools for another text representation. Choose Base32 Encoder / Decoder for RFC 4648 Base32 with its A-Z and 2-7 alphabet. Choose Punycode Converter for internationalized domain-name labels. Choose Unicode Converter for \uXXXX escapes and hidden-character inspection.

Where Base64 conversion comes up

Encode a text value, then copy Output into a field that accepts Base64. To inspect an encoded value, paste it into Input, choose Decode, and read the returned UTF-8 text.

Upload a Markdown or plain-text file, encode its contents, and save the result with Download. Compare Standard (+ /) and URL-Safe (- _) when another format specifies one alphabet.

Frequently asked questions

How do I encode text to Base64?

Paste the text into Input, choose Encode, and choose Standard (+ /) or URL-Safe (- _) under Variant. The encoded value appears in Output.

How do I decode Base64 without adding padding?

Choose Decode and paste the Base64 value into Input. Decode adds missing = padding before converting the value to UTF-8 text.

Why does Auto-detect encode my Base64 string?

Auto-detect chooses Decode only when the cleaned value matches the accepted pattern and its length is divisible by 4. Choose Decode when the value is unpadded or when you already know the direction.

Does Base64 Encoder / Decoder send my Input to a server?

The conversion code processes Input in the browser. This page's tool code contains no request that sends Input to a server. The result appears in Output.

Which Base64 variant should I choose?

Choose Standard (+ /) for standard Base64 output. Choose URL-Safe (- _) when the receiving format expects hyphens and underscores. Decode accepts both symbol sets.

Related Tools

59 views