Get your own Node server
// Create a string
const str = 'Hello, World!';

// Convert to different encodings
const utf8Buffer = Buffer.from(str, 'utf8');
console.log('UTF-8:', utf8Buffer);

const base64Str = utf8Buffer.toString('base64');
console.log('Base64 string:', base64Str);

const hexStr = utf8Buffer.toString('hex');
console.log('Hex string:', hexStr);

// Convert back to original
const fromBase64 = Buffer.from(base64Str, 'base64').toString('utf8');
console.log('From Base64:', fromBase64);

const fromHex = Buffer.from(hexStr, 'hex').toString('utf8');
console.log('From Hex:', fromHex);

              
UTF-8: <Buffer 48 65 6c 6c 6f 2c 20 57 6f 72 6c 64 21>
Base64 string: SGVsbG8sIFdvcmxkIQ==
Hex string: 48656c6c6f2c20576f726c6421
From Base64: Hello, World!
From Hex: Hello, World!