v149 · JavaScript

Encode & Decode

Type text in the top box. The pipeline shows every step: text → bytes (via TextEncoder) → base64 (via toBase64()) → bytes (via fromBase64()) → text (via TextDecoder). All steps happen live in your browser.

Feature detection: checking…

① Input text

↓ TextEncoder → Uint8Array

② Byte array (first 32 bytes shown)

↓ Uint8Array.prototype.toBase64()

③ Base64 string

new_method: arr.toBase64()

↓ Uint8Array.fromBase64(str)

④ Decoded byte array (round-trip)

new_method: Uint8Array.fromBase64(str)

↓ TextDecoder

⑤ Decoded text

Enter text above to start
const encoder = new TextEncoder();
const decoder = new TextDecoder();

// ① Text → bytes
const bytes = encoder.encode("Hello, Chrome 149!");

// ② Bytes → base64  (NEW in Chrome 149)
const b64 = bytes.toBase64();
// → "SGVsbG8sIENocm9tZSAxNDkh"

// ③ Base64 → bytes  (NEW in Chrome 149)
const roundTripped = Uint8Array.fromBase64(b64);

// ④ Bytes → text
const text = decoder.decode(roundTripped);
// → "Hello, Chrome 149!"

see also

implementation reference

Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗