Developer Base64 Encoder / Decoder

Base64 Encoder / Decoder

Convert text or files up to 200MB to Base64, or decode a Base64 string back to its original form.

How to use this tool

Choose Encode or Decode and type or paste; the result updates as you go. Decoding accepts standard Base64, the URL-safe kind used in JWTs, with or without its = padding, and a whole data: URL. If the decoded bytes aren't text, use Download file to save them. Files up to 200 MB can be encoded too.

Worked example: why the length varies

  • Hello, world! is 13 bytes and encodes to SGVsbG8sIHdvcmxkIQ==, 20 characters. The two = fill the last group of four, because 13 isn't a multiple of 3.
  • नमस्ते ₹499 is 11 characters (नमस्ते alone is 6: four letters, a virama and a vowel sign), but in UTF-8 each of those six and the ₹ sign take 3 bytes, making 25 bytes and 36 characters of Base64.
  • Hello, world!?> encodes to SGVsbG8sIHdvcmxkIT8+; the URL-safe form, which this tool also decodes, ends in - instead of +.

When another tool gives different Base64

Base64 encodes bytes, so the result depends on how the text was turned into bytes first. This tool uses UTF-8, like most programming languages and the web. Windows PowerShell's -EncodedCommand is the common exception: it expects the command encoded as UTF-16 ([Text.Encoding]::Unicode), where every character takes at least two bytes, so the same text gives longer, different Base64. Line endings matter too: a file saved on Windows has an invisible carriage return before each line break, which a text box like this one drops, so encoding the file and encoding its pasted text differ.

Frequently Asked Questions

Is Base64 encryption?

No. Base64 is an encoding with no key: anyone can decode it, as this page shows. It exists to carry bytes through places that only accept text, such as JSON fields, email and data URLs. A password or API key written in Base64, for example in a config file, is only hidden from someone who doesn't try.

Why did decoding produce garbled text instead of my original content?

Either the bytes aren't text at all, such as an image or a PDF, in which case the page says so and Download file saves them intact, or the text was encoded with something other than UTF-8, such as UTF-16 from PowerShell or a legacy Windows code page. In the second case every other character may show as a symbol or a gap.

Is my data uploaded anywhere?

No. Encoding and decoding happen entirely in your browser: text is processed as you type, and files are handled by a background worker on your device. Nothing is sent to a server.

Related Tools

Related Blog Posts