Axonix Tools
Encoding Tool

Free Base64 Encoder & Decoder Online

The best free base64 encoder and decoder online. Encode text to base64 or decode base64 strings back to plain text instantly.

Plain Text
Enter text you want to encode
Base64 Output
View your conversion results

Built With Care

“Uses the browser's built-in atob() and btoa() functions for standards-compliant encoding and decoding. Supports Unicode and handles multi-line strings.”

Base64 Converter & Developer Inspector

Encode plain text to Base64 or decode Base64 back to readable text. Uses the browser's native atob/btoa functions so nothing gets sent anywhere. Handles Unicode and emojis correctly.

base64 encoderbase64 decode onlinebase64 to textencode to base64
How to Use Base64 Converter & Developer Inspector
  • 1Toggle the mode to either 'Encode' (Text to Base64) or 'Decode' (Base64 to Text).
  • 2Paste your source material into the input field. The tool handles multi-line strings effortlessly.
  • 3Click the action button to perform the transformation instantly.
  • 4Inspect the output for accuracy and use the copy button to transfer it to your clipboard.
  • 5Use the 'Swap' button to quickly reverse the transformation or verify your results.
Key Features
  • Bidirectional Processing: Encode or decode in either direction from one screen.
  • Developer-First Precision: Perfect for handling JWT parts, Basic Auth headers, and data URIs.
  • Standard RFC 4648 Compliance: Compatible with all modern programming languages and web APIs.
  • Client-side processing: No data is sent to external servers.
  • Large Payload Support: Handles massive strings and complex JSON blobs without performance degradation.

Base64 Converter & Developer Inspector Specs

Limits

  • Text and file base64 encode/decode
  • Handles unicode via UTF-8

Formats

  • Output: base64 string or decoded text/file

Defaults

  • UTF-8 for text
  • Data URI option for files

How it works

  • btoa/atob with UTF-8 polyfill

Honest caveats

  • Not encryption
  • Large files may exceed memory limits

Real Ways People Use This

API Development & Debugging

Quickly decode Basic Auth headers or inspect JWT payloads during backend troubleshooting and integration testing.

Data URI Generation

Encode small assets or SVG strings to create data URIs for CSS or HTML embedded images.

Email Header Inspection

Decode email subjects or body parts that are encoded in Base64 for transport across legacy systems.

Configuration Mangement

Safely encode config files or environment variables that need to be passed as single-line strings in CI/CD pipelines.

Cross-Language Data Passing

Standardize complex data formats into safely transportable ASCII strings for inter-service communication.

Related Guides & Tutorials

Important Notes
  • Base64 is an encoding scheme, not encryption. Anyone can decode a Base64 string. Never use it to protect sensitive data without actual encryption.
  • For binary data like images or files, use the dedicated Base64 Image Decoder tool for better results.
Quick Checklist
  • 1Verify your input is valid UTF-8 text before encoding to avoid garbled output.
  • 2Check for trailing '=' padding when decoding — it's normal and part of the RFC 4648 standard.

Questions That Usually Come Up

More Tools You’ll Actually Use

The Whole Scheme

Base64 is an alphabet,not a secret.

Three input bytes become four characters. Each byte dissolves into eight bits, every 24-bit window regroups into four 6-bit values, and each 6-bit value (0–63) maps to one printable ASCII slot. That is the entire algorithm — no key, no checksum, no compression. Base64 exists to move binary through text-only plumbing: emails, headers, URLs, JSON payloads.

Work the example once and every string you have ever seen decodes on sight. The encoder is not magic — it is a lookup table with a fixed rhythm.

From 3 letters to 4 charactersRFC 4648
1 · bytes (ASCII → binary)
M 01001101 · a 01100001 · n 01101110
2 · regroup the 24 bits into four 6-bit windows
010011010110000101101110
3 · 6-bit values pick positions in the alphabet
1922546
4 · output characters
TWFu
19 → T · 22 → W · 5 → F · 46 → u. Base64 grows data by exactly a third because 24 bits become 4 characters (4 × 8 = 32 bits of ASCII to carry 24 real ones).
Alphabet Map

The 64 slots, in order

ValuesCharactersWorth knowing
0 – 25A – ZUppercase first.
26 – 51a – zLowercase next.
52 – 610 – 9Digits come after letters — the order everyone forgets.
62+Becomes - in Base64URL.
63/Becomes _ in Base64URL.
padding=Fills the final group to a multiple of 4. Stripped in Base64URL.
Padding, decoded

Why the string ends in one or two =

Input arrives in 3-byte groups. Whatever bytes are left over dictate the padding — the decoder reads it to know how many real bytes the final group carried.

3 bytes alignedxxxxNo padding — the group is exactly full.
2 bytes remainxxx=One '=' carries the missing byte.
1 byte remainsxx==Two '=' carry the missing two bytes.
Proof by Example

The official test vectors — the encoder’s promise

$ node -e "Buffer.from('foo').toString('base64')"

RFC 4648 §10 defines these exact outputs. Any encoder — this one, a standard library, a coworker’s regex — must land on the same strings or it is not Base64. We ran every row through Node’s buffer implementation before publishing this page; a mismatch anywhere in the table means the table is wrong, not the spec.

InputBytesBase64
f1Zg==
fo2Zm8=
foo3Zm9v
foob4Zm9vYg==
fooba5Zm9vYmE=
foobar6Zm9vYmFy

Sanity check yourself: "foobar" → Zm9vYmFy is the string every Linux terminal spits out. Memorize that one — it catches wrong tooling instantly.

The JWT Trap

Base64URL swaps the last two symbols

Standard Base64 uses + and / — both reserved characters in URLs. Base64URL replaces them with - and _ and usually drops the padding. Same 6-bit grouping, different 2 slots, no =.

StandardBase64URL
62 / 63+ /- _
Padding= requiredusually stripped
"foob"Zm9vYg==Zm9vYg

Decoding a JWT header or an Authorization cookie with the standard decoder dies on the first - or _. Swap those two characters for + and / and decode again — or use the JWT Decoder built for exactly this.

Open the JWT Decoder
Growth Math

It always comes out one-third bigger

Output length is exactly 4 × ceil(n ÷ 3) characters, padding included. A clean multiple of three grows by exactly 4/3 — everything else rounds up at the tail.

InputOutputGrowth
3 bytes4 chars1.333×
300 bytes400 chars1.333×
1,000 bytes1,336 chars1.336× (odd trailing group adds padding)
1 MB (1,048,576 B)1,398,104 chars1.333× — always 4 × ceil(n ÷ 3)

Not encryption — ever

Base64 is reversible by design and by anyone. Credentials inside a Basic Auth header cross the wire in the clear unless TLS wraps them. Treat every decoded secret as compromised; hash, encrypt, or rotate — never “just Base64 it.”

Worked example: an HTTP Basic Auth header

The browser sends username:password as Base64 — foo:bar becomes Zm9vOmJhcg==. Paste the header value into this page’s decoder and read the credentials back — which is precisely why anyone sniffing the wire still needs TLS in front of it.

URL Encoder next