Simulator
Buffers Playground
A Buffer is raw memory — a fixed-size sequence of bytes outside V8's heap. Type below and watch your text become real UTF-8 bytes, then view the same memory as hex, base64, or bits.
const buf = Buffer.from("Héllo 🌍!")12 bytes8 charactersbytes ≠ characters — that's UTF-8!The byte grid — one cell per byte of memory
ASCII characters fit in a single byte. Accented letters and emoji need 2–4 bytes; bytes belonging to the same character share a color.
Each cell shows hex (top), decimal (middle), and the character it belongs to (bottom; continuation bytes show ·). This is why buf.length counts bytes, not characters.
Buffer.alloc(n) — claiming raw memory
const buf = Buffer.alloc(16)Buffer.alloc(n) reserves n bytes and zero-fills them for safety (its faster sibling Buffer.allocUnsafe(n) skips the zeroing and may contain old memory). Drag the slider to grow or shrink the allocation.
16 zero-filled bytes = 128bits of memory, allocated outside V8's garbage-collected heap.