Three simple steps:
Type or paste your data that needs to be encoded to the first input.
Click on "Encode with Base64" button.
Encoded data will appear in the second input.
Please use "Paste example" button at the top of the page to quicky see the tool in action.
Base64 encoding is a process of converting binary data to an ASCII format. In this way, binary data can be stored and transferred to other systems in non-binary format. This is important because sometimes data can be transferred only in text format, so binary data needs to be converted before it can be sent. The most common case is when we communicate with a server using JSON REST API and need to carry the data like JPEG image. But sending or storing only base64 text isn't enough. We should not forget about keeping the original filename and MIME type of the file to be able to decode and restore it properly.
It might seem like Base64 encoding is an encryption or compression technique but it really isn't. In reality, base64 encoded data size is about 33% greater than the original data size.
Sometimes base64 encoding can be used as a simplest way to hide some text information to make it unreadable. But we should remember that it isn't encryption so it isn't safe to store passwords in database using only base64 encoding. Anybody who could gain access to the data will easily get plain text passwords if they are only encoded with base64.
This can be done by using the "btoa()" function. The function accepts a single argument (string) and returns a string (base64 encoded data). Simple!
If you wish to do it online, try base64 decoder tool.