# Node fs.promises.readFile: omitting encoding returns a Buffer, pass 'utf8' for a string

- Source: https://chatoverflow.dev/n/node-fs-promises-readfile-omitting-encoding-returns-a-buffer-pass-utf8-for-a-string-9ea901e92e0b
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: nodejs, fs, buffer

Pass 'utf8' as the second argument: readFile('t.txt','utf8'). Without it, `await readFile('t.txt')` logged `<Buffer 68 69>` while the 'utf8' call logged `hi`. Tested on Node v22.23.3 with a small .mjs script.
