Skip to content

Menu

Base64 Encoder / Decoder

Encode and decode Base64 strings with support for text and file input.

Runs entirely in your browserEncodingFree, no sign-up
Loading tool

01What is Base64 Encoder / Decoder?

Base64 is how binary data travels through systems built for text: email attachments, data: URIs in CSS, HTTP Basic Auth headers, JWT segments and the values in a Kubernetes Secret. This tool encodes text or a whole file to Base64, and decodes Base64 back to readable text. It follows RFC 4648, the IETF spec that defines both the standard alphabet and the URL-safe one. Encoding works in two steps. Your text is first turned into UTF-8 bytes, then every 3 bytes become 4 characters from A-Z, a-z, 0-9, + and /. If the last group is short, = signs pad it out. Because of that first UTF-8 step, accented letters and emoji survive the round trip. "héllo ✓" becomes aMOpbGxvIOKckw==, with é taking two bytes and the check mark three. The URL-safe Base64 checkbox switches to the alphabet in section 5 of the RFC. It swaps + for - and / for _, and it drops the trailing padding. That's the form JWTs use. As a quick example, "???" encodes to Pz8/ normally and Pz8_ with the box ticked. "Hello, World!" goes from SGVsbG8sIFdvcmxkIQ== to SGVsbG8sIFdvcmxkIQ. Decoding is relaxed on purpose. It accepts both alphabets, with or without padding, and ignores spaces and line breaks. So you can paste a wrapped block or a bare JWT payload as is. It still refuses real problems, with three separate messages. One covers characters that aren't Base64, one a length that can't be valid, and one bytes that aren't UTF-8 text. Upload File on the Encode tab reads any file locally with the browser's FileReader and shows its raw Base64. The URL-safe checkbox applies to files too. You get the bare Base64, not a full data: URI, so add a prefix such as data:image/png;base64, yourself. There are honest limits here. The decoder only shows text. Decode an image or a binary key and you get the UTF-8 error, not a file you can download. Very large files produce very large strings, which can make the output box sluggish. And Base64 hides nothing: anyone can decode a Basic Auth header or a JWT payload. The text you type and any file you pick are read by this page alone and never posted to a server.

Web and API developers who inline small assets, inspect JWTs or Basic Auth headers, and prepare Base64 values for config files. The tool runs entirely in your browser, so your data never leaves your device.

02How to use Base64 Encoder / Decoder

  1. Pick the Encode or Decode tab.
  2. Type or paste text (to encode) or Base64 (to decode) into the input box. The output updates as you type.
  3. Tick URL-safe Base64 if the result is going into a URL, file name or JWT.
  4. To encode a file, click Upload File on the Encode tab and choose it. Typing in the input box switches back to text.
  5. Use Copy Output to take the result, Swap to send it back the other way, or Reset to clear everything.

03Worked examples

Input: Hello, World!
Result: SGVsbG8sIFdvcmxkIQ==
With URL-safe Base64 ticked the padding is dropped: SGVsbG8sIFdvcmxkIQ.
Input: héllo ✓
Result: aMOpbGxvIOKckw==
UTF-8 first: é is two bytes, ✓ is three.
Input: ???
Result: Standard Pz8/ · URL-safe Pz8_
URL-safe swaps / for _ and + for -.
Input: ~~~
Result: Standard fn5+ · URL-safe fn5-
Input: user:pass
Result: dXNlcjpwYXNz
The value after "Basic " in an HTTP Basic Auth header.
Input: Decode SGVsbG8 (no padding)
Result: Hello
Missing padding is added back before decoding.

04Common use cases

  • Encoding a small SVG icon or font with Upload File, then adding a data: prefix to inline it in CSS
  • Decoding the payload segment of a JWT from a failing request to read its claims, without first adding padding
  • Checking the username:password inside an HTTP Basic Auth header while debugging with test credentials
  • Producing the Base64 value for a Kubernetes Secret data field from a plain config string
  • Decoding a wrapped Base64 blob from an API response or email source without removing the line breaks first
  • Making URL-safe tokens for query strings or file names with the URL-safe Base64 checkbox

05Tips

  • Base64 adds about 33 percent (4 characters per 3 bytes). Inline data URIs also can't be cached separately, so keep them for small icons.
  • Base64 is an encoding, not encryption. A Kubernetes Secret or Basic Auth header in Base64 is readable by anyone who sees it.
  • If decoding fails with the UTF-8 message, the data is binary. Use a command-line decoder and write the bytes to a file instead.
  • A length error usually means a character was lost when copying. Valid Base64 never leaves a single character in the last group of four.
  • Shell gotcha: echo adds a newline, so echo hi | base64 gives aGkK, while this tool gives aGk= for hi.

06Related concepts

RFC 4648, Data URI, MIME encoding, Base32.

Frequently Asked Questions

What is Base64 Encoder / Decoder?

Base64 Encoder / Decoder is a free, browser-based developer tool on AIDToolStack. Encode and decode Base64 strings with support for text and file input. It requires no installation or sign-up and works entirely in your browser.

Is Base64 Encoder / Decoder free to use?

Yes. No sign-up, no fees and no usage cap.

Does Base64 Encoder / Decoder store my data?

No. It runs in your browser; nothing is uploaded.

Video

From our YouTube channel. The player loads from YouTube only when you press play.

Cheat sheet

Related Tools

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe