Base64 Encoder / Decoder
Encode text to Base64 or decode a Base64 string back to text — with an optional URL-safe alphabet — entirely in your browser.
Runs entirely in your browser — nothing is sent to our servers.
Off uses standard Base64 (+ / with = padding); on produces the URL-safe variant used by JWTs and URL path segments.
How to use it
- Choose Encode or Decode.
- For Encode, optionally turn on the URL-safe alphabet.
- Paste your input on the left.
- Read the result on the right and copy it — decode accepts standard or URL-safe input either way.
Input
aGVsbG8gYTJ6dXRpbC5kZXYgd29ybGQ=What is Base64?
Base64 turns arbitrary text or binary data into an ASCII-safe string, using an alphabet of 64 characters (A-Z, a-z, 0-9, plus two more) that survives being pasted into places that don't handle raw binary or every Unicode character cleanly — HTTP headers, data URIs, authentication tokens, and config files. It is fully reversible: decoding produces exactly the original bytes back.
Why use this tool
Everything happens in your browser. Base64 payloads frequently contain credentials or personal data — an API key, a JWT, a basic-auth header — so a converter that posts your input to a backend is a bad habit. This one has no backend to post to.
Encoding uses the browser's own UTF-8-aware APIs, which means emoji and non-Latin scripts round-trip correctly rather than producing mojibake — a common failure with hand-rolled or older Base64 utilities that assume Latin-1 input.
Decoding here is deliberately lenient: it accepts standard and URL-safe Base64 interchangeably and re-pads truncated input automatically, so you don't need to know which variant produced a string before pasting it in.
Base64 encoding gotchas
Standard vs. URL-safe Base64 alphabets
There are two Base64 alphabets in common use, and mixing them up is the most common decode failure elsewhere: standard Base64 uses + and /, while the URL-safe variant replaces those with - and _ so the string survives being placed directly in a URL without further encoding. The URL-safe toggle above switches the encoder between the two; decode on this page accepts either automatically, so you don't need to match it manually.
Missing padding breaks decoding — elsewhere
Standard Base64 pads its output with trailing = characters to a multiple of 4, and some systems (JWTs, some URL-safe contexts) strip that padding before transmitting it. A decoder that insists on padding will reject an otherwise-valid unpadded string, which looks like corruption but is really just a missing = or two — this page's decoder re-pads automatically, but a stricter decoder elsewhere may not.
Related tools
URL Encoder / Decoder
Percent-encode or decode a URL component.
Case Converter
camelCase, snake_case, kebab-case, PascalCase and more, all at once.
Find & Replace
Regex, whole-word and case-sensitive search and replace, in place.
JSON Formatter
Format, minify and validate JSON, with auto-repair for common invalid JSON.
JSON ↔ CSV
Convert a JSON array of objects to CSV, or back.
JSON Compare
Diff two JSON documents, path by path.
SQL Formatter
Indent queries with keyword casing options.
UUID v4 Generator
Generate one or many cryptographically random UUID v4s.
Text Transform
Lines to a delimited list, and back.
BIN Checker
Card issuer lookup from a BIN/IIN.
Temporary Email
A disposable inbox for live-testing incoming mail.
Webhook
Inspect live webhook deliveries.