What is the Base64 Encoder/Decoder?
Base64 is an encoding that represents arbitrary bytes using only 64 printable ASCII characters: A-Z, a-z, 0-9, + and /, with = used for padding. It exists because many protocols, such as email (MIME), JSON and HTTP headers, were designed for text and cannot safely carry raw binary data.
Base64 is not encryption. Anyone can decode it, so it must never be used to protect secrets. It also increases size by roughly one third, because every 3 bytes of input become 4 characters of output. The URL-safe variant replaces + and / with - and _ so the result can be used in URLs and JWTs without escaping.
When to use the Base64 Encoder/Decoder
Developers use Base64 to embed small images in CSS or HTML as data URIs, to carry binary attachments inside JSON, to read the credentials in an HTTP Basic authentication header, and to inspect the segments of a JWT. Mail systems encode attachments with it, and many APIs return signatures or keys in Base64. When something looks like a long string of letters and digits ending in equals signs, decoding it is often the quickest way to learn what it contains, whether that turns out to be readable text, JSON or binary data such as an image.
How to use the Base64 Encoder/Decoder
- Choose Encode or Decode.
- Paste your text or Base64 string into the input box.
- Enable the URL-safe option if the string will be used in a URL, filename or JWT segment.
- The output updates immediately; invalid Base64 shows a clear error.
- Copy the result with one click.
Examples
Text: Hello, World!
Base64: SGVsbG8sIFdvcmxkIQ==
Text: héllo ✓
Base64: aMOpbGxvIOKckw==
URL-safe (no padding): SGVsbG8sIFdvcmxkIQIn JavaScript, btoa() only handles Latin-1, so UTF-8 text must be converted to bytes first, which this tool does for you.
Common errors and tips
- Incorrect padding errors appear when the string length is not a multiple of 4; add
=characters or enable padding repair. - Whitespace and line breaks copied from emails are ignored by the decoder, but other characters are not.
- Decoded output that looks like random symbols usually means the original data was binary (an image or archive), not text.
- Never treat Base64 as a way to hide passwords or API keys.
- Use the URL-safe alphabet for JWT segments and query string values.
Privacy: runs entirely in your browser
Encoding and decoding use your browser's built-in functions; the text you enter is never sent over the network. This tool runs entirely in your browser: nothing you enter is uploaded, stored or logged on our servers, and it keeps working even if you go offline after the page has loaded.
Frequently asked questions
Is Base64 a form of encryption?
No. It is a reversible encoding with no key. Anyone who sees a Base64 string can decode it instantly, so use real encryption such as AES for confidential data.
Why does Base64 end with = signs?
The equals signs are padding so the output length is a multiple of four characters. Some systems omit padding, which is common in URL-safe Base64.
What is URL-safe Base64?
+ and / for - and _ (RFC 4648 section 5) so the string can appear in URLs and filenames without percent-encoding.Does it support emoji and accented characters?
Yes. Text is converted to UTF-8 bytes before encoding and decoded back as UTF-8, so non-ASCII characters round-trip correctly.
Why does the output grow larger?
Base64 maps every 3 input bytes to 4 output characters, so encoded data is about 33 percent larger than the original.
Ratings & reviews
–
0 reviews
- 5 star
- 0 reviews (0%)
- 4 star
- 0 reviews (0%)
- 3 star
- 0 reviews (0%)
- 2 star
- 0 reviews (0%)
- 1 star
- 0 reviews (0%)
No reviews yet — be the first to share your experience.
Write a review
Reviews are moderated before they appear.
Related tools
Beautify, minify and validate JSON instantly, with exact line and column for every syntax error.
Use toolGenerate random v4 and time-ordered v7 UUIDs in bulk, with one-click copy and format options.
Use toolTest JavaScript regular expressions live, with highlighted matches, capture groups and flag toggles.
Use toolDecode JSON Web Tokens to inspect the header, payload and expiry, all without sending the token anywhere.
Use toolConvert Unix timestamps to readable dates and back, in UTC or your local timezone, in seconds or milliseconds.
Use toolJSON to CSV Converter
Developer
Turn an array of JSON objects into a clean CSV file for Excel or Google Sheets in one click.
Use tool
