Base64 encode

This will encode or decode base64, urlencode, rot13 or htmlentities to its counterpart.

How to encode text as Base64

  1. Type or paste your text into the Input box. Base64 encode is already selected.
  2. Press Submit.
  3. Copy the Base64 string from the Output box.

Examples

  • Hello, world! becomes SGVsbG8sIHdvcmxkIQ==
  • hi becomes aGk= and hi! becomes aGkh, which shows how padding depends on length
  • café becomes Y2Fmw6k=: the text is encoded as UTF-8 bytes first
  • user:pass becomes dXNlcjpwYXNz, ready for an Authorization: Basic dXNlcjpwYXNz header

What you get

  • Standard Base64 (RFC 4648) with + and /, padded with = to a multiple of four characters.
  • One continuous line, with no line breaks added.
  • The output is about a third longer than the input: every 3 bytes become 4 characters.

Line breaks in your input are encoded too. If you don't want them in the result, remove them before you submit.

Where Base64 is used

Base64 lets binary or non-ASCII data travel through systems that only handle plain text: email attachments (MIME), data: URIs in HTML and CSS, HTTP Basic authentication, JSON payloads and YAML or environment-variable configs.

FAQ

Do I need URL-safe Base64? If the result goes into a URL or a file name, many systems expect - and _ instead of + and /, often without padding. Swap those characters in the output yourself.

Is my text encrypted now? No. Base64 is a reversible format, not a secret. Use Base64 decode to see for yourself.


Base64 decode encode

Base64 is a byte sequence of 8-bit padded ascii in mime.

More: Wikipedia and RFC 2045

URLencode decode encode

Tyically used for passing strings and variables between web pages

More info: php.net and RFC 3986


ROT13 encode

Rotates the characters 13 places. Since the basic latin1 alphabet has 26 characters, performing rot13 on a string encrypts it. Do it twice, and it's decrypted.

More info: Wikipedia and php.net

HTMLentities decode encode

Encodes or decodes all characters that have a HTML equivalent entity.

More info: php.net and w3.org