Base64 Encoder

Base64 Encoder / Decoder

เข้ารหัสข้อความหรือไฟล์เป็น Base64 หรือถอดรหัส Base64 กลับ รูปแบบ URL-safe, ปลอดภัย UTF-8, ฝั่งไคลเอ็นต์เท่านั้น

ไม่ การเข้ารหัสและถอดรหัสทั้งหมดเกิดขึ้นในเบราว์เซอร์ของคุณโดยใช้ JavaScript API ในตัว (TextEncoder, btoa, atob) ไม่มีอะไรถูกอัปโหลด บันทึก หรือเก็บ

Base64 มาตรฐานใช้ + และ / ซึ่งมีความหมายพิเศษใน URL URL-safe Base64 (RFC 4648 §5) แทนที่ด้วย - และ _ ตามลำดับ ดังนั้นเอาต์พุตจึงปลอดภัยที่จะใช้ใน URL, ชื่อไฟล์ และโทเค็นเช่น JWT

อินพุต

0 อักขระ

เอาต์พุตที่ถอดรหัส

0 อักขระ

ทำไมต้อง Base64?

รวดเร็ว แม่นยำ พร้อมทุกตัวเลือกที่คุณคาดหวัง

เข้ารหัสและถอดรหัส

แปลงข้อความหรือไฟล์ใดๆ เป็น Base64 หรือถอดรหัส Base64 กลับเป็นข้อมูลต้นฉบับ ดูตัวอย่างทันทีขณะพิมพ์

ความเป็นส่วนตัวตามการออกแบบ

การเข้ารหัสและถอดรหัสทั้งหมดเกิดขึ้นในเบราว์เซอร์ของคุณ ข้อความและไฟล์ของคุณไม่เคยถูกอัปโหลดไปยังเซิร์ฟเวอร์ใดๆ

ไฟล์ & data URL

วางไฟล์ใดๆ เพื่อรับสตริง Base64, data URL (data:mime;base64,…) หรือถอดรหัสสตริง Base64 กลับเป็นไฟล์ไบนารี

รูปแบบ URL-safe

สลับ Base64 แบบ URL-safe (Base64URL, RFC 4648) — แทนที่ + ด้วย - และ / ด้วย _ เพื่อใช้ใน URL, ชื่อไฟล์, JWT ฯลฯ

ปลอดภัย UTF-8

รองรับ Unicode เต็มรูปแบบสำหรับทุกภาษา, อีโมจิ, CJK, สคริปต์ RTL ใช้ TextEncoder/TextDecoder เพื่อไม่ให้มีอะไรเสียหาย

ตัดบรรทัด & padding

ตัดบรรทัดสไตล์ MIME ที่ 64 หรือ 76 อักขระเป็นตัวเลือก และตัด padding เป็นตัวเลือก — สำหรับลายเซ็น, cookie, โทเค็นกะทัดรัด

How Base64 encoding works in your browser

Native browser APIs, no upload, lossless round-trip for any text or file.

  1. 1

    Pick text or file mode

    Toggle between text mode (paste any string) and file mode (drop any file up to ~50 MB). Text is processed via TextEncoder for proper UTF-8 handling — emoji and non-ASCII characters round-trip correctly. Files are read as ArrayBuffer.

  2. 2

    Encoder runs locally

    JavaScript's built-in btoa encodes the bytes to Base64. For URL-safe variant we replace + with - and / with _, and optionally strip padding (the format JWT uses). For very large files we chunk encoding to avoid blocking the main thread.

  3. 3

    Decoder is the inverse

    Paste a Base64 string and we run atob to decode. If you encoded a binary file originally, we offer a download with the original MIME type; if you encoded text, we decode it back via TextDecoder. Both directions are lossless.

  4. 4

    Copy, download, or generate a Data URI

    One-click copy puts the Base64 on your clipboard. Or download as a .txt file. Or generate a data:image/png;base64,... URI for inline embedding in CSS / HTML — assembled in your browser.

Common Base64 workflows

What people actually use Base64 for, and how iKit fits in.

Embedding small images in CSS

Convert a 2 KB icon to a Data URI to inline it in a stylesheet — saves an HTTP request. iKit produces the full data:image/png;base64,... string ready to paste.

JWT debugging

Decode the middle segment of a JWT to inspect the claims. Pair this with iKit's JSON Decoder for a clean two-step debugging flow that never sends the token to a server.

Email attachments via API

When a transactional email API requires Base64-encoded attachments, drop the file into iKit, copy the result, paste into your request body. No CLI base64 dance, no platform differences (macOS vs Linux flags).

PEM keys and certificates

Decode a PEM block (after stripping the BEGIN/END lines) to inspect the raw DER bytes. Or encode a binary key into PEM for tools that only accept text format.

Why Base64 privacy is non-negotiable

Base64 is the default carrier for sensitive payloads — JWTs containing user IDs and permissions, embedded customer photos, internal API responses. A server-side Base64 tool sees every byte you paste. iKit's encoder runs purely in JavaScript, so nothing leaves your browser tab.

  • Zero fetch or XHR calls during encode or decode.
  • Files up to ~50 MB processed locally without upload.
  • Lossless round-trip — encode then decode returns the exact original bytes.

คู่มือที่เกี่ยวข้อง

บทความเชิงลึกและการเปรียบเทียบเครื่องมือจากบล็อก iKit

คำถามที่พบบ่อย

ข้อมูลของฉันถูกส่งไปยังเซิร์ฟเวอร์หรือไม่?

ไม่ การเข้ารหัสและถอดรหัสทั้งหมดเกิดขึ้นในเบราว์เซอร์ของคุณโดยใช้ JavaScript API ในตัว (TextEncoder, btoa, atob) ไม่มีอะไรถูกอัปโหลด บันทึก หรือเก็บ

URL-safe Base64 คืออะไร?

Base64 มาตรฐานใช้ + และ / ซึ่งมีความหมายพิเศษใน URL URL-safe Base64 (RFC 4648 §5) แทนที่ด้วย - และ _ ตามลำดับ ดังนั้นเอาต์พุตจึงปลอดภัยที่จะใช้ใน URL, ชื่อไฟล์ และโทเค็นเช่น JWT

รองรับ Unicode / อีโมจิอย่างถูกต้องหรือไม่?

ใช่ เราใช้ TextEncoder เพื่อแปลงข้อความของคุณเป็นไบต์ UTF-8 ก่อนเข้ารหัส และ TextDecoder เพื่อแปลงไบต์ที่ถอดรหัสกลับ อักขระ Unicode ใดๆ — CJK, อีโมจิ, สคริปต์ RTL — จะวนกลับอย่างถูกต้อง

ฉันสามารถเข้ารหัสไฟล์เช่น PDF หรือรูปภาพได้หรือไม่?

ได้ สลับเป็นโหมดไฟล์และวางไฟล์ใดๆ เครื่องมือให้สตริง Base64, data URL ที่คุณสามารถวางลงใน HTML/CSS หรือการดาวน์โหลด.txt ขนาดไฟล์ถูกจำกัดโดยหน่วยความจำของเบราว์เซอร์ (โดยปกติทำงานได้ถึงหลายร้อย MB)

ความแตกต่างระหว่างมีและไม่มี padding คืออะไร?

Base64 มาตรฐานเติม '=' ลงในเอาต์พุตเพื่อให้ความยาวเป็นทวีคูณของ 4 การใช้งานบางอย่าง (JWT, โทเค็น URL) ตัด padding เพื่อประหยัดพื้นที่; ตัวถอดรหัสสามารถสร้างใหม่ได้ ทำเครื่องหมาย 'ไม่มี padding' เพื่อตัด = ที่ท้าย