Browser Support for Base64
Learn which browsers support Base64
Built-in browser support
btoa() is used to encode strings.
atob() is used to decode strings.
However, there are caveats. Not all inputs are well-supported by all browsers, and some types of inputs require pre-processing before handing it off to
btoa(). See The Unicode Problem on MDN.
Support via libraries
Third-party libraries can be used instead of built-in browser methods. These libraries often can handle browser implementation inconsistencies, and the "Unicode Problem" referenced above.
Popular libraries include:
All popular server-side programming languages have native support for Base64 encoding and decoding. Any languages which do not have support, or have additional intricacies, are very likely to have libraries available to add support. If your use case requires encoding and decoding on the server instead of the client (browser), server-side encoding and decoding is certainly an option.
We've also written about Base64 operating system support, if that's what you're looking for.
Last updated on December 9, 2019