Website Management Tools

Base64 Encode Decode

Convert text to Base64 or decode Base64 strings back to readable text, with full UTF-8 support for accents and emoji. Encoding runs in your browser.

Runs in your browserNever uploaded to PagesTools.
Preparing tool…

The focused browser interface is loading.

100% privateYour input stays on this deviceLightning fastNo upload round-tripBrowser-basedProcessing runs on this deviceFree to useNo account required

What Base64 encoding actually does

Base64 represents binary bytes using a limited alphabet of letters, numbers, plus, slash, and optional equals-sign padding. It is useful when data must travel through a text-only field, such as a JSON property, an email body, a configuration value, or a data URL. Encoding changes the representation; decoding reverses it when the original bytes are available.

Base64 is not encryption, hashing, compression, or anonymization. Anyone who sees the encoded value can decode it without a password. In fact, the encoded output is usually about one third larger than the original byte sequence. Use it for compatibility and transport, not to protect credentials or confidential content.

How to encode text

  1. Select Encode and enter or paste the source text.
  2. Keep spaces, line breaks, and punctuation exactly as they should be preserved.
  3. Run the conversion and copy the Base64 output.
  4. Decode a sample if another system will depend on byte-for-byte accuracy.

Text must first become bytes. This tool uses UTF-8, the standard encoding used across the web, so characters outside basic ASCII may occupy several bytes. That is why a Base64 value created by a legacy Latin-1 system can decode differently even though both strings look structurally valid.

How to decode Base64

  1. Select Decode and paste the complete Base64 value.
  2. Remove a surrounding label such as data:text/plain;base64, if you only need the payload.
  3. Run the conversion and review the resulting UTF-8 text.
  4. If decoding fails, check for a truncated string, invalid characters, or the URL-safe alphabet.

Standard Base64 commonly uses plus and slash. The URL-safe variant substitutes hyphen and underscore so values fit more safely in URLs and filenames, and it may omit equals-sign padding. Convert those characters or choose a URL-safe-aware decoder when input comes from a JWT, web token, or filename.

Useful cases and important limits

Embedding small values

Base64 is convenient for small inline assets, test fixtures, API examples, and data that must remain inside a text document. It can represent any bytes, but this text-focused converter displays decoded output as UTF-8. Arbitrary image, archive, or executable data may render as replacement characters and should be handled with a file-aware encoder instead.

Diagnosing integrations

Developers often use a converter to inspect a Basic Authentication credential during local debugging, verify an API sample, or compare serialization across languages. Do not paste a live password, private key, session token, or production authorization header into any web tool. Reproduce the structure with disposable test values.

Avoiding double encoding

A Base64 string can itself be encoded again, producing valid but unexpected output. If one decode yields another long string made almost entirely from the Base64 alphabet, check whether an upstream system encoded the value twice. Agree on where encoding happens and document the expected character encoding at each boundary.

Line breaks, padding, and data URLs

Some email-era formats wrap Base64 across fixed-width lines, while JSON and most API fields expect one uninterrupted string. Whitespace may be ignored by a tolerant decoder but rejected by a strict one. Preserve or remove wrapping according to the receiving specification instead of assuming either form works everywhere.

A browser data URL combines a media type and Base64 payload, for example an image prefix followed by encoded bytes. The prefix is metadata and must not be decoded as part of the payload. Large inline assets make HTML or CSS harder to cache and inspect, so reserve data URLs for small resources with a measured benefit.

Privacy

The text conversion runs locally in your browser. Your input and output do not need to be uploaded to PagesTools for encoding or decoding. Data you later paste into another application is governed by that application's handling. Close the page or clear the fields on a shared device, and remember that clipboard managers and browser extensions may retain copied values independently of this tool.

Common questions

Frequently asked questions

Is Base64 a secure way to hide a password?

No. Base64 has no secret key and provides no confidentiality; decoding is immediate and universally available. Use a vetted encryption scheme for reversible secret storage and a password-hashing function for passwords. Avoid entering real secrets into a converter even when the conversion itself occurs locally.

Why does Base64 output end with one or two equals signs?

The equals signs are padding used when the input byte count does not divide evenly into three-byte groups. They help represent the final group in four Base64 characters. Some URL-safe formats omit padding, but adding or removing it without understanding the receiving system can cause compatibility errors.

Can Base64 make a file smaller?

No. Standard Base64 expands data by roughly 33 percent before line wrapping or surrounding markup. Compress the original data with an appropriate format when size matters, then Base64-encode only if a text-only channel requires it. For web assets, a normal file URL is often more cache-friendly.

Why are decoded accented characters or emoji broken?

The encoder and decoder must agree on the character-to-byte encoding. This tool uses UTF-8. If the source system encoded text as Latin-1, Windows-1252, UTF-16, or another charset, a valid Base64 decode can still produce incorrect text. Identify the original charset and convert those bytes accordingly.

What is URL-safe Base64?

URL-safe Base64 replaces plus with hyphen and slash with underscore, and it often removes trailing padding. Those changes avoid characters with special meaning in URLs and filenames. The underlying grouping is the same, but a strict standard decoder may require the alphabet and padding to be restored.