JavaScript btoa

btoa() - Encodes a string in base64 format

Function

btoa ( string )

Parameters

string - The string to be encoded

Return

Returns the encoded string

Example

btoa('use javascript btoa to encode data in base64 format')

Output

dXNlIGphdmFzY3JpcHQgYnRvYSB0byBlbmNvZGUgZGF0YSBpbiBiYXNlNjQgZm9ybWF0

See also: