Skip to content
CalcTide logo
Tech

Base64 Encoder Decoder

Base64 turns bytes into text-safe characters, but it does not hide the original data. Use this Base64 encoder decoder when you need to turn UTF-8 text into a Base64 string for transport, or inspect a Base64 value and turn it back into readable text. It is useful for checking API payloads, Basic Auth strings, small JSON blobs, data URL fragments, and copied values from logs or config files.

TechBy

Quick answer

Base64 uses a limited alphabet of letters, numbers, plus, slash, and sometimes trailing equals signs for padding.

What this tells you

  • Base64 uses a limited alphabet of letters, numbers, plus, slash, and sometimes trailing equals signs for padding.
  • Encoding starts with UTF-8 text, converts that text to bytes, then maps those bytes into Base64 characters.
  • Decoding runs the process in reverse and tries to rebuild valid UTF-8 text from the Base64 input.
  • The tool reports invalid Base64 clearly instead of guessing when the input is broken or not text.

How to Use

  1. 1Paste plain text if you want to encode it, or paste a Base64 string if you want to decode it.
  2. 2Choose Encode Base64 to turn readable text into a Base64 value for transport or storage.
  3. 3Choose Decode Base64 to turn a Base64 value back into UTF-8 text.
  4. 4Review the output and the input and output lengths, then copy the result where you need it.

How It Works

Formula

Encode: UTF-8 text -> bytes -> Base64 Decode: Base64 -> bytes -> UTF-8 text

Base64 works on bytes, not on abstract characters. When you encode, the browser first converts your text to UTF-8 bytes. Those bytes are then regrouped into 6-bit chunks, and each chunk is mapped to a Base64 character. When you decode, the process reverses. The Base64 characters become bytes again, and the tool then reads those bytes as UTF-8 text. That is why ordinary English text, accented characters, and emoji can work, but only if the original data was valid UTF-8 text in the first place.

Calculation note: values are processed in the order shown above, using the current input units.

Worked Examples

Encode plain text

Inputhello world
ActionEncode Base64
ResultaGVsbG8gd29ybGQ=

This is the standard Base64 form of hello world in UTF-8.

Decode a common greeting

InputSGVsbG8h
ActionDecode Base64
ResultHello!

The Base64 value SGVsbG8h decodes to the text Hello! including the exclamation mark.

Encode an API credential fragment

Inputuser:pass
ActionEncode Base64
ResultdXNlcjpwYXNz

Pairs like username:password are often Base64-encoded before they are placed into a Basic Authorization header.

Encode a short JSON payload

Input{"ok":true}
ActionEncode Base64
ResulteyJvayI6dHJ1ZX0=

Small JSON fragments are often encoded before they are embedded in query values, tokens, or transport fields.

Common Base64 Strings

Handy examples you are likely to recognize while debugging logs, headers, or payloads.

Original textBase64 outputWhy you might see it
hello worldaGVsbG8gd29ybGQ=Basic test string
Hello!SGVsbG8hGreeting or sample payload
user:passdXNlcjpwYXNzBasic Auth credential fragment
{"ok":true}eyJvayI6dHJ1ZX0=Short JSON blob
plain textcGxhaW4gdGV4dA==Simple transport example
https://example.comaHR0cHM6Ly9leGFtcGxlLmNvbQ==Encoded URL value

These outputs are stable because Base64 is a deterministic encoding. The same UTF-8 text always produces the same Base64 string.

What Base64 Is Good For and What It Is Not

Base64 solves a transport problem. Some systems are built for plain text and can break when raw bytes, control characters, or mixed encodings pass through them. By converting bytes into a limited text alphabet, Base64 makes data safer to move through JSON fields, email bodies, HTML attributes, cookies, and older protocols that were designed around printable characters.

That practical benefit also explains why developers keep running into Base64 during ordinary work. You may inspect a JWT segment, a data URI, a copied attachment body, a browser storage value, or an Authorization header and see a long block of letters, numbers, plus, slash, and equals signs. This tool helps you quickly answer the first question, which is usually not What standard is this, but What does this thing actually say.

Base64 is not encryption and it is not compression. Anyone who can read the string can decode it. It also makes the payload larger, usually by about one third before line wrapping or transport overhead. Use it when text-safe transport matters. Do not use it when you need secrecy, integrity, or smaller file size.

URL Encoder Decoder

Common mistakes

  • Treating Base64 as security. If the goal is secrecy, you need encryption, not an encoding that anyone can reverse.
  • Trying to decode arbitrary binary as text. A valid Base64 string can still represent image bytes, compressed data, or some other non-text payload.
  • Removing padding or characters while copying. Missing equals signs, line breaks in the wrong place, or one dropped character can make decoding fail.
  • Assuming every decoded byte sequence is UTF-8. Some systems still emit Latin-1, UTF-16, or raw binary, which this text-focused decoder will not present cleanly.

Embed this calculator on your site

Drop this single line where you want the calculator to appear. It is responsive, mobile-friendly, resizes automatically, and is free to use with attribution.

<script src="https://calctide.com/embed.js" data-tool="base64-encoder-decoder" async></script>

Preview the embed at /embed/base64-encoder-decoder/.

Frequently Asked Questions

Base64 is a way to write raw bytes using ordinary text characters. Instead of sending the original bytes directly, the data is recoded into letters, numbers, plus, slash, and sometimes equals signs. That makes it easier to move binary data through systems that expect text.
No. Base64 only changes the representation of the data. It does not protect the content. If someone can see the Base64 string, they can usually decode it in a second. Use encryption when you need confidentiality and Base64 only when you need a text-safe format.
The equals sign is padding. Base64 works in fixed groups, so when the original byte count does not fit perfectly, padding characters are added at the end to complete the final block. They are normal and do not mean the input is broken.
The usual causes are a missing character, stray spaces from copying, bad padding, or an input that is not actually Base64. Another common case is valid Base64 that represents non-text bytes rather than UTF-8 text. In that case the encoded data exists, but it is not meant to be read as plain text.
Yes, for the encoded credential part. A Basic Auth header usually contains the word Basic followed by a Base64 value. If you decode that value, you often get a username:password pair. That is exactly why Base64 should never be treated as a security layer by itself.
Yes. The encoded form is usually about 33% larger than the original bytes because every 3 bytes become 4 Base64 characters. That size tradeoff is accepted because the output is easier to transport through text-oriented systems.
No. The encoding and decoding happen entirely in the browser using built-in text and Base64 APIs. That makes the tool suitable for quick debugging of plain text values without sending them off-page.
It estimates base64 encoder decoder outputs using the visible inputs and formula assumptions on this page.

Explore More in Tech