Base64 เข้ารหัส / ถอดรหัส
เข้ารหัสข้อความเป็น Base64 หรือถอดรหัสกลับเป็นข้อความธรรมดา
Base64 คืออะไรและเมื่อใดที่ใช้?
วิธีเข้ารหัสและถอดรหัส
Base64 มาตรฐาน เทียบกับ URL-safe Base64
Base64 เป็นรูปแบบการเข้ารหัสที่แทนข้อมูลไบนารีโดยใช้อักขระ ASCII ที่พิมพ์ได้เพียง 64 ตัว ชื่อมาจากตัวอักษร 64 ตัวที่ใช้: A–Z, a–z, 0–9, + และ / ออกแบบมาเพื่อวัตถุประสงค์เดียว: ส่งข้อมูลอย่างปลอดภัยผ่านช่องทางที่รองรับเฉพาะข้อความธรรมดา
การใช้งานจริงที่พบบ่อย ได้แก่ การฝังรูปภาพโดยตรงใน HTML หรือ CSS (data:image/png;base64,…) การเข้ารหัส payload ไบนารีใน JSON APIs การจัดเก็บไฟล์เล็กๆ ใน localStorage และการส่งข้อมูลในอีเมล (การเข้ารหัส MIME)
Base64 มาตรฐานใช้ + และ / ซึ่งมีความหมายพิเศษใน URL URL-safe Base64 แทนที่ด้วย - และ _ และละเว้น padding คุณจะพบ URL-safe Base64 ใน JWT, OAuth tokens และพารามิเตอร์ API บางตัว
- ในการเข้ารหัส: วางข้อความธรรมดาในช่องป้อนข้อมูลและคลิก Encode → สตริง Base64 จะปรากฏในเอาต์พุต
- ในการถอดรหัส: วางสตริง Base64 ในช่องป้อนข้อมูลและคลิก ← Decode ข้อความต้นฉบับจะปรากฏในเอาต์พุต
- ใช้ Swap ⇅ เพื่อย้ายเอาต์พุตกลับไปยังอินพุตสำหรับการดำเนินการแบบลูกโซ่
คำถามที่พบบ่อย
- What is Base64 encoding?
- Base64 converts binary data (or any text) into a string of 64 safe ASCII characters (A–Z, a–z, 0–9, +, /). It's used to safely transmit data in contexts that only support text — like embedding images in HTML, sending binary data in JSON, or storing data in cookies.
- Is Base64 the same as encryption?
- No. Base64 is encoding, not encryption. It's fully reversible by anyone who sees it — there's no key, no secret, no security. Never use Base64 to protect sensitive data. Use it only to encode data so it survives text-only transport.
- Does this tool support Unicode and emoji?
- Yes. The encoder uses encodeURIComponent + unescape internally to handle the full Unicode range before passing to btoa(), so characters like ₹, 中文, and emoji all encode and decode correctly.
- Is my data sent to a server?
- No. Encoding and decoding happen in your browser using JavaScript's built-in btoa() and atob() functions. Nothing is uploaded or logged.
- What's the = sign at the end of Base64?
- Base64 encodes 3 bytes at a time into 4 characters. If the input isn't a multiple of 3 bytes, padding characters (=) are added to make the output length a multiple of 4. One = means 1 padding byte; == means 2.
เครื่องมือที่เกี่ยวข้อง
- JSON Formatter, Validator & Repair Tool
Format, minify, validate, and repair JSON instantly in your browser. Sort keys alphabetically, auto-format on paste, download as file, escape/unescape strings — free, no sign-up, 100% client-side.
- ตัวสร้าง QR Code
สร้าง QR code สำหรับ URL ข้อความ Wi-Fi และอื่นๆ ดาวน์โหลดเป็น PNG
- ตัวสร้างรหัสผ่าน
สร้างรหัสผ่านสุ่มที่แข็งแกร่งด้วยความยาวและชุดอักขระที่กำหนดเอง
- URL เข้ารหัส / ถอดรหัส
เข้ารหัสหรือถอดรหัส URL และ query strings ด้วย percent-encoding
- ตัวสร้างแฮช
สร้างแฮช SHA-1, SHA-256, SHA-384 และ SHA-512 ได้ทันที