toolo.dev

Base64 Encode Online

Base64 encode text online. Text is read as UTF-8, so accents, Chinese and emoji match Node.js and Python, and a Base64URL switch makes JWT and URL-safe output.

About the Base64 Encoder

Base64 encode text here and the result appears as you type. Your text is read as UTF-8, so é, 你好 and 👋 give the same Base64 as Node.js Buffer or Python's base64 module, and a URL-safe (Base64URL) switch gives you the variant used in JWTs and links.

Base64 (RFC 4648) writes any bytes with 64 plain characters: A to Z, a to z, 0 to 9, + and /, plus = for padding. You need it wherever a system only takes text: the Authorization: Basic header, the data fields of a Kubernetes Secret, data: URLs in CSS and HTML, email attachments, or a JSON field that has to carry a certificate. The encoding happens in your browser, so a password you encode for a Basic auth header stays on your machine.

  1. Put your text in Text to encode, or press Load sample for a line with accents, Chinese characters and an emoji.
  2. The Encoded text box updates a moment after you stop typing. There's no button to press.
  3. Turn on URL-safe (Base64URL) when the output goes into a URL parameter, a file name or a JWT. The note under the switch shows what changes: - and _ replace + and /, and the = padding is dropped.
  4. Check the two numbers under the result. Input counts UTF-8 bytes, not characters, so it's higher than your text length when the text has multi-byte characters. Output is about four thirds of the input.
  5. Press Copy at the top right of Encoded text. If you pasted from a terminal or a file, check for a trailing line break first: Hello encodes to SGVsbG8=, but Hello followed by a newline gives SGVsbG8K.