What is Base64?
4 November 2022 (Updated 7 November 2022)
In a nutshell
Base64 is a group of binary-to-text encoding schemes that lets you represent binary data in an ASCII string format by translating the binary into a radix-64 representation.
Because base64 encoding uses only ASCII characters, binary data can be base64 encoded and then used in a
Encode binary string into base64 using
btoa('Hello world') // 'SGVsbG8gd29ybGQ='
Decode base64 into string using
atob('SGVsbG8gd29ybGQ=') // 'Hello world'
- Because of how Base64 encoding works, a base64 encoded version will be at least ~33% larger than its source.