Decoded Size
{{ stats.outputBytes.toLocaleString() }} bytes
Input {{ stats.inputBytes.toLocaleString() }} B ×{{ stats.ratio }}
Base64 Data
Decoded Text
Recent Decodes
  • {{ h }}

Introduction:

Base64 is a text-friendly representation of binary data. By mapping every three bytes to four printable characters, it safeguards files travelling through systems restricted to ASCII, such as legacy email, JSON APIs, or URL query strings. The added padding characters ensure message length is always divisible by four, preserving byte boundaries during transport and reconstruction.

With this decoder you paste or drop any Base64 fragment, optionally marked as a data URI, and the reactive engine instantly restores the original bytes in your browser. Switches adjust for URL-safe variations, missing padding, or stray whitespace. Statistical counters show input and output sizes, and an optional media preview renders images, audio, or video without external calls.

Developers often copy embedded image sprites from CSS or HTML that arrive Base64-encoded; decoding them here produces the PNG file ready for inspection. Remember that Base64 is not encryption—anyone holding an encoded string can restore its contents, so never embed confidential credentials or personal data in publicly shared links or code snippets.

Technical Details:

Base64 translates binary octets into six-bit chunks, each represented by an index character drawn from the sets A–Z, a–z, 0–9, plus symbols “+” and “/”. Because 6 does not divide evenly into 8, the scheme processes data in 24-bit groups, emitting four output characters per group. The special “=” sign pads the final block so that the total always aligns to multiples of four characters, enabling stream reassembly without ambiguity across disparate transport layers.

Core Equation

Bout= 3Lin4 P

Variables: Lin – input length (characters); P – number of “=” padding symbols; Bout – decoded bytes.

Interpretation

IndicatorTypical RangeMeaning
Size ratio (Bout/Lin)0.74 – 0.76Healthy Base64 payload
< 0.74Excess paddingLikely copied with line breaks
> 0.76Missing paddingEnable “No padding” fix

Parameters

ParameterMeaning
inputBase64 string or full data URI
urlSafeConverts “-” and “_” to “+” and “/”
noPaddingAdds trailing “=” where length % 4 ≠ 0
stripWsRemoves spaces, tabs, and newlines
wrapToggles soft-wrapping in text areas

Example — decode SGVsbG8h:

SGVsbG8h 010010000110010101101100 “Hello!”

Assumptions & Limitations

  • Input uses standard 64-character alphabet; URL-safe flag corrects the subset.
  • Whitespace removal is optional; unexpected spaces trigger decoding errors.
  • Decoder assumes UTF-8 output; binary files preview only when mime type is supplied.
  • Extremely long strings may exhaust browser memory on low-spec devices.

Edge Cases & Error Sources

  • Single-character padding (“=”) miscounted when input trimmed incorrectly.
  • Line-wrapped email payloads require stripWs to merge fragments.
  • URL-encoded “%2B” or “%2F” must be decoded before Base64 processing.
  • Malformed data URI headers prevent mime-type detection.

Scientific Validity & References

Concept formalised in MIME Part 1 (RFC 2045) and generalised in RFC 4648, which also defines the URL-safe alphabet.

All decoding occurs locally, meeting GDPR and similar privacy regulations.

Step-by-Step Guide:

Follow this sequence to restore readable content from any Base64 snippet.

  1. Paste, type, or drop your string into the main input area.
  2. If the alphabet uses “-” and “_”, enable URL-safe.
  3. Activate No padding when trailing “=” signs are missing.
  4. Use Strip whitespace to clean pasted email or log fragments.
  5. Review the decoded output before sharing; it may reveal sensitive data.

FAQ:

Is my data stored?

Your string is processed entirely in your browser and never transmitted anywhere.

Does Base64 compress data?

No. Base64 inflates size by roughly 33 percent. It encodes, not compresses.

What is URL-safe Base64?

A variant that replaces “+” and “/” with “-” and “_” so the result remains URL-friendly.

Why does my string end with “==”?

The “=” symbols pad the final block so its length divides evenly by four characters.

How large can the input be?

Modern browsers handle several megabytes, but decoding very large blobs may exhaust memory.

Glossary:

Base64
64-symbol scheme converting binary to text.
Padding
“=” added to align length to four-char blocks.
URL-safe
Alphabet variant using “-” and “_”.
Data URI
Inline resource beginning data:<mime>;base64,.
Ratio
Decoded bytes divided by input length.

No data is transmitted or stored server-side.