Standard Base64 (RFC 4648)

Published

In this guide

This standards reference on Base64Encoding explains main in plain language for developers and everyday users.

Everything important stays private: try the matching converter or tool in your browser — files and tokens are not uploaded.

Read the full English article below for code samples and edge cases, or switch language anytime from the menu. We keep expanding translations from real user feedback.

Try these private tools next

RFC 4648 section 4 defines the “base64” encoding that most programming languages implement by default: btoa(), PHP’s base64_encode(), Python’s b64encode(), Java’s Base64.getEncoder(), and so on.

Rules

  • Alphabet: A–Z a–z 0–9 + / (see Base64 characters).
  • Padding with = so the length is always a multiple of 4.
  • No line breaks. RFC 4648 says implementations must not add line feeds unless a referring specification (like MIME) explicitly requires them.
  • Decoders must reject characters outside the alphabet unless the referring specification says otherwise.
  • Unused bits in the last character should be zero (canonical encoding); strict decoders may reject non-zero bits.

Validation regex

^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$

This matches every valid padded value, including the empty string. Check your value interactively with the Base64 validator.

  • Base64URL for URLs and tokens
  • MIME for e-mail with line wrapping

常見問題

Does this page upload my data?

No. Articles are static. Linked tools run locally in your browser unless a feature explicitly needs a network relay.

Can I request a translation or a new tool?

Yes — use the private feedback form. We prioritize what users ask for across languages.

What is the fastest way to try main?

Open the homepage Base64 converter or the related tools linked on this page and paste a sample.

相關工具與指南

留言 (0)

對「Standard Base64 (RFC 4648)」有問題、想法或發現錯誤嗎?歡迎留言、為工具評分或回覆他人。

目前還沒有留言,歡迎搶先分享您的意見!

發表留言

為此工具評分:
Esc
↑ ↓ 移動↵ 開啟Esc 關閉